public async Task <HttpResponseMessage> StartCalculation(PromotionViewModel postedViewModel) { var mapper = GetMapper(); var commission = mapper.Map <Promotion>(postedViewModel); var entityCreated = await businessService.PutInProcessQueueAsync(postedViewModel.Year, postedViewModel.Month); if (entityCreated.ReturnStatus == false) { return(CreateErrorResponse(entityCreated)); } return(CreateViewModelResponse(postedViewModel, entityCreated)); }
public async Task <HttpResponseMessage> Add(PromotionViewModel postedViewModel) { var mapper = GetMapper(); var entityCreating = mapper.Map <Promotion>(postedViewModel); var entityCreated = await businessService.AddPromotionAsync(entityCreating); if (entityCreated.ReturnStatus == false) { return(CreateErrorResponse(entityCreated)); } return(CreateViewModelResponse(postedViewModel, entityCreated)); }