public async Task <IHttpActionResult> Replace(int id, BrakeConfigInputModel model) { BrakeConfig brakeConfig = new BrakeConfig() { Id = model.Id, FrontBrakeTypeId = model.FrontBrakeTypeId, RearBrakeTypeId = model.RearBrakeTypeId, BrakeABSId = model.BrakeABSId, BrakeSystemId = model.BrakeSystemId, VehicleToBrakeConfigs = model.VehicleToBrakeConfigs.Select(item => new VehicleToBrakeConfig { BrakeConfigId = item.BrakeConfigId, Id = item.Id, VehicleId = item.VehicleId }).ToList(), }; CommentsStagingModel comment = new CommentsStagingModel { Comment = model.Comment }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _brakeConfigApplicationService.ReplaceAsync(brakeConfig, id, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }
public async Task <IHttpActionResult> Post(int id, BrakeConfigInputModel model) { BrakeConfig brakeConfig = new BrakeConfig() { Id = model.Id, VehicleToBrakeConfigCount = model.VehicleToBrakeConfigCount }; CommentsStagingModel comment = new CommentsStagingModel() { Comment = model.Comment, }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _brakeConfigApplicationService.DeleteAsync(brakeConfig, id, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }
public async Task <IHttpActionResult> Post(BrakeConfigInputModel model) { BrakeConfig brakeConfig = new BrakeConfig() { Id = model.Id, FrontBrakeTypeId = model.FrontBrakeTypeId, RearBrakeTypeId = model.RearBrakeTypeId, BrakeABSId = model.BrakeABSId, BrakeSystemId = model.BrakeSystemId }; CommentsStagingModel comment = new CommentsStagingModel() { Comment = model.Comment }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _brakeConfigApplicationService.AddAsync(brakeConfig, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }