示例#1
0
        public async Task Put(DayBookItemDto dayBookItemDto)
        {
            var dayBookItem = this.mapper.Map <DayBookItem>(dayBookItemDto);

            dayBookItem.Change = DateTime.Now;

            await this.dayBookItemsService.UpdateAsync(dayBookItem);
        }
示例#2
0
        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);
        }