public async Task<IHttpActionResult> Post(VehicleTypeGroupInputModel model) { if (model == null) { return BadRequest(ErrorMessage.TypeGroup.RequiredTypeGroupInputModel); } if (model.Name == null) { return BadRequest(ErrorMessage.TypeGroup.RequiredTypeGroup); } VehicleTypeGroup typeGroup = new VehicleTypeGroup() { Id = model.Id, Name = model.Name, }; CommentsStagingModel comment = new CommentsStagingModel() { Comment = model.Comment }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _vehicleTypeGroupApplicationService.AddAsync(typeGroup, CurrentUser.Email, comment, attachments); return Ok(changeRequestId); }
public async Task<IHttpActionResult> Delete(int id, VehicleTypeGroupInputModel vehicleInputModel) { CommentsStagingModel comment = new CommentsStagingModel() { Comment = vehicleInputModel.Comment }; var attachments = SetUpAttachmentsModels(vehicleInputModel.Attachments); var changeRequestId = await _vehicleTypeGroupApplicationService.DeleteAsync(null, id, CurrentUser.Email, comment, attachments); return Ok(changeRequestId); }