using System.Data.Entity;
public static void Main()
Z.EntityFramework.Classic.EntityFrameworkManager.UseFiddleSqlCompact(System.Data.Entity.SqlServerCompact.SqlCeProviderServices.Instance, System.Data.SqlServerCe.SqlCeProviderFactory.Instance);
using (var context = new EntityContext())
var list = context.Accounts.Include(x => x.Customer).ToList();
var account = context.Accounts.Find(1);
account.Customer = new Customer {
var list2 = context.Accounts.Include(x => x.Customer).ToList();
public static void GenerateData()
using (var context = new EntityContext())
context.Accounts.Add(new Account {
Customer = new Customer {
public class EntityContext : DbContext
public EntityContext() : base(@"Data Source=ZZZ_Projects.sdf")
public DbSet<Customer> Customers { get; set; }
public DbSet<Account> Accounts { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public int CustomerId {get;set;}
public Customer Customer {get;set;}