Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }