using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Dynamic.Core;
public static void Main()
var context = new EntityContext();
bool allHavePriceGreaterThan2 = context.Orders.All("Price > 2");
Console.WriteLine("allHavePriceGreaterThan2 = {0}", allHavePriceGreaterThan2);
public static void GenerateData()
var orders = new List<Order>
new Order { Amount = 5, Price = 3 },
new Order { Amount = 10, Price = 8 }
using (var context = new EntityContext())
context.Orders.AddRange(orders);
context.BulkSaveChanges();
public class EntityContext : DbContext
public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Order> Orders { get; set; }
public int Id { get; set; }
public int Amount { get; set; }
public double Price { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public string CompanyName { get; set; }
public string City { get; set; }
public string Phone { get; set; }