using System.Data.Common;
using System.Data.Entity;
public static void Main()
var connection = Effort.DbConnectionFactory.CreateTransient();
GenerateData(connection);
using (var context = new EntityContext(connection))
var list = context.Customers.ToList();
FiddleHelper.WriteTable("Customers", list);
public static void GenerateData(DbConnection connection)
using (var context = new EntityContext(connection))
context.Customers.Add(new Customer() { Name ="Customer_A", Description = "Description", IsActive = true, LastLogin = new DateTime(2010,1,1) });
context.Customers.Add(new Customer() { Name ="Customer_B", Description = "Description", IsActive = true, LastLogin = new DateTime(2010,1,1) });
context.Customers.Add(new Customer() { Name ="Customer_C", Description = "Description", IsActive = true, LastLogin = DateTime.Now });
public class EntityContext : DbContext
public EntityContext(DbConnection connection) : base(connection, true)
this.Configuration.LazyLoadingEnabled = false;
this.Configuration.ProxyCreationEnabled = false;
public DbSet<Customer> Customers { get; set; }
public int CustomerID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public DateTime LastLogin { get; set; }
public Boolean IsActive { get; set; }