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