public async Task <CakeRequest> AddAsync(CakeRequest entity) { _log.LogInformation($"Adding cake request from user id {entity.CreatedById} to user id {entity.AssignedToId}"); _cakelistContext.Requests.Add(entity); await _cakelistContext.SaveChangesAsync(); _log.LogInformation($"Added cake request with id: {entity.Id}"); return(entity); }
public async Task <User> AddAsync(User entity) { _log.LogInformation($"Adding user with name: {entity.FullName()}"); var user = _cakelistContext.Users.Add(entity); await _cakelistContext.SaveChangesAsync(); _log.LogInformation($"User added with id {entity.Id}"); return(user.Entity); }