public async Task <FoodGroup> CreateOneAsync(FoodGroup foodGroup) { await _context.FoodGroups.AddAsync(foodGroup); await _context.SaveChangesAsync(); _context.Entry(foodGroup).State = EntityState.Detached; return(foodGroup); }
public async Task <User> CreateOneAsync(User user) { await _context.Users.AddAsync(user); await _context.SaveChangesAsync(); _context.Entry(user).State = EntityState.Detached; return(user); }
public async Task <Publication> CreateOneAsync(Publication publication) { await _context.Publications.AddAsync(publication); await _context.SaveChangesAsync(); _context.Entry(publication).State = EntityState.Detached; return(publication); }