using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Dynamic.Core;
public static void Main()
using (var context = new EntityContext())
var list = context.Customers.Where("City = @0", "Paris").ToList();
FiddleHelper.WriteTable("Customers", list);
using (var context = new EntityContext())
var list = context.Customers.Where("it.City = @0", "London").ToList();
FiddleHelper.WriteTable("Customers using 'it' keyword", list);
public static void GenerateData()
List<Customer> list = new List<Customer>();
Name = "Terri Lee Duffy",
Name = "Michael Sullivan",
Name = "Rebecca Bradley",
using (var context = new EntityContext())
context.Customers.AddRange(list);
context.BulkSaveChanges();
public class EntityContext : DbContext
public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Customer> Customers { get; set; }
public int CustomerID { get; set; }
public string Name { get; set; }
public string CompanyName { get; set; }
public string City { get; set; }
public string Phone { get; set; }