public IEnumerable <Customer> FindBy(string customerFullName) { using (var ctx = new NNCJDBContext()) { return(ctx.Customers.Where(m => m.CustomerFullName.Contains(customerFullName)).ToList()); } }
public IEnumerable <Customer> FindAll() { using (var ctx = new NNCJDBContext()) { return(ctx.Customers.Take(100).ToList()); } }
public void PersistUpdatOf(IAggregateRoot entity) { using (var context = new NNCJDBContext()) { context.Entry <Customer>((Customer)entity).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void PersistDeletionOf(IAggregateRoot entity) { using (var context = new NNCJDBContext()) { context.Customers.Remove((Customer)entity); context.SaveChanges(); } }