public Allergen GetById(Guid id) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(AllergenMapper.MapAllergenPersistenceToAllergenEntity(_context.Allergens.SingleOrDefault(c => c.Id.Equals(id)))); } }
public IEnumerable <Allergen> GetAll() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(AllergenMapper.MapAllergenPersistenceCollectionToAllergenEntityCollection(_context.Allergens.ToList())); } }
public void Update(Allergen entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { _context.Update(AllergenMapper.MapAllergenEntityToAllergenPersistence(entity)); _context.SaveChanges(); } }