Ejemplo n.º 1
0
 public bool Update(UpdateBeerEntity item)
 {
     using (Context context = new Context())
     {
         EfBeerEntityRepository rep     = new EfBeerEntityRepository(context);
         BeerEntityConvert      convert = new BeerEntityConvert(context);
         return(rep.Update(convert.ToEntity(item)));
     }
 }
Ejemplo n.º 2
0
 public List <ReadBeerEntity> GetAll()
 {
     using (Context context = new Context())
     {
         EfBeerEntityRepository rep     = new EfBeerEntityRepository(context);
         BeerEntityConvert      convert = new BeerEntityConvert(context);
         return(convert.ToReadList(rep.GetAll()));
     }
 }
Ejemplo n.º 3
0
 public ReadBeerEntity Remove(int id)
 {
     using (Context context = new Context())
     {
         EfBeerEntityRepository rep     = new EfBeerEntityRepository(context);
         BeerEntityConvert      convert = new BeerEntityConvert(context);
         return(convert.ToRead(rep.Remove(id)));
     }
 }
Ejemplo n.º 4
0
 public ReadBeerEntity Add(CreateBeerEntity item)
 {
     using (Context context = new Context())
     {
         EfBeerEntityRepository rep     = new EfBeerEntityRepository(context);
         BeerEntityConvert      convert = new BeerEntityConvert(context);
         return(convert.ToRead(rep.Add(convert.ToEntity(item))));
     }
 }