public PharmacyOffers GetById(Guid id) { using (DataContext _context = new DataContext()) { return(PharmacyOffersMapper.MapPharmacyOffersPersistenceToPharmacyOffersEntity(_context.PharmacyOffers.SingleOrDefault(c => c.IdOffer.Equals(id)))); } }
public IEnumerable <PharmacyOffers> GetAll() { using (DataContext _context = new DataContext()) { return(PharmacyOffersMapper.MapPharmacyOffersPersistanceCollectionToPharmacyOffersEntityCollection(_context.PharmacyOffers.ToList())); } }
public void Update(PharmacyOffers entity) { using (DataContext _context = new DataContext()) { _context.Update(PharmacyOffersMapper.MapPharmacyOffersEntityToPharmacyOffersPersistance(entity)); _context.SaveChanges(); } }