public Bitters Get(int id) { var entity = _dataContext.Bitters .Include(b => b.CocktailBitters) .SingleOrDefault(b => b.BittersId == id); return(entity == null ? null : BittersEntity.Map(entity)); }
public Bitters Add(Bitters model) { var entity = BittersEntity.Map(model); var newBitters = _dataContext.Bitters.Add(entity).Entity; _dataContext.SaveChanges(); return(BittersEntity.Map(newBitters)); }