using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Dynamic.Core;
public static void Main()
string preparedStatement = "Name == \"Janice Galvin\"";
var context = new EntityContext();
var result = context.Customers.Where(c => c.City.Equals("Paris")).ToList();
FiddleHelper.WriteTable("First Try", result);
var resultDynamic = context.Customers.Where(preparedStatement).ToList();
FiddleHelper.WriteTable(resultDynamic);
public static void GenerateData()
var list = new List<Customer>();
{Name = "Terri Lee Duffy", CompanyName = "ABC", City = "Paris"});
{Name = "Janice Galvin", CompanyName = "XYZ", City = "London"});
{Name = "Michael Raheem", CompanyName = "DEF", City = "New York"});
{Name = "Michael Sullivan", CompanyName = "ABC", City = "Paris"});
{Name = "Rebecca Bradley", CompanyName = "KLM", City = "Tokyo"});
using (var context = new EntityContext())
context.Customers.AddRange(list);
context.BulkSaveChanges();
public class EntityContext : DbContext
public EntityContext(): base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Customer> Customers
public string CompanyName