using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Dynamic.Core;
public static void Main()
var context = new EntityContext();
var query1 = context.Customers
.Where("Gender in (\"Female\")");
var config = new ParsingConfig
UseParameterizedNamesInDynamicQuery = true
var query2 = context.Customers
.Where("Gender = \"Female\"");
public static void GenerateData()
var list = new List<Customer>();
Name = "Terri Lee Duffy",
Location = new Location() { Name = "test" },
LastContact = DateTimeOffset.Parse("2022-11-14"),
Location = new Location() { Name = "ohter test", UpdateAt = DateTimeOffset.Parse("2022-11-16") },
LastContact = DateTimeOffset.Parse("2022-11-16"),
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 DbSet<Location> Locations { 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; }
public Location Location { get; set; }
public DateTimeOffset? LastContact { get; set; }
public Gender Gender { get; set; }
public int LocationID { get; set; }
public string Name { get; set; }
public DateTimeOffset UpdateAt { get; set; }