Exemplo n.º 1
0
 public bool Update(UpdateSale item)
 {
     using (Context context = new Context())
     {
         EfSaleRepository rep     = new EfSaleRepository(context);
         SaleConvert      convert = new SaleConvert(context);
         return(rep.Update(convert.ToEntity(item)));
     }
 }
Exemplo n.º 2
0
 public List <ReadSale> GetAll()
 {
     using (Context context = new Context())
     {
         EfSaleRepository rep     = new EfSaleRepository(context);
         SaleConvert      convert = new SaleConvert(context);
         return(convert.ToReadList(rep.GetAll()));
     }
 }
Exemplo n.º 3
0
 public ReadSale Remove(int id)
 {
     using (Context context = new Context())
     {
         EfSaleRepository rep     = new EfSaleRepository(context);
         SaleConvert      convert = new SaleConvert(context);
         return(convert.ToRead(rep.Remove(id)));
     }
 }
Exemplo n.º 4
0
 public ReadSale Add(CreateSale item)
 {
     using (Context context = new Context())
     {
         EfSaleRepository rep     = new EfSaleRepository(context);
         SaleConvert      convert = new SaleConvert(context);
         return(convert.ToRead(rep.Add(convert.ToEntity(item))));
     }
 }