public async Task Put(DayBookItemDto dayBookItemDto) { var dayBookItem = this.mapper.Map <DayBookItem>(dayBookItemDto); dayBookItem.Change = DateTime.Now; await this.dayBookItemsService.UpdateAsync(dayBookItem); }
public async Task Post(DayBookItemDto dayBookItemDto) { var dayBookItem = this.mapper.Map <DayBookItem>(dayBookItemDto); var user = await this.usersService.GetUserByCurrentSessionToken(); dayBookItem.DayBookItemId = Guid.NewGuid(); dayBookItem.CreationDate = DateTime.Now; dayBookItem.Change = DateTime.Now; dayBookItem.UserId = user.UserId; await this.dayBookItemsService.AddAsync(dayBookItem); }