コード例 #1
0
        public async Task <ActionResult <Bank> > Post(string userId, MaintenanceCalendar model)
        {
            var user = await _accountRepository.GetByIdAsync(userId);

            model.User = user;
            var entity = await _genericRepository.CreateAsync(model);

            return(new CreatedAtRouteResult("GetMaintenanceCalendar", new { id = entity.Id }, entity));
        }
コード例 #2
0
        public async Task <IActionResult> Put(string userId, int id, MaintenanceCalendar model)
        {
            model.Id = id;
            var user = await _accountRepository.GetByIdAsync(userId);

            model.User = user;
            await _genericRepository.UpdateAsync(model);

            return(NoContent());
        }