public CreditRequestListItemViewModel CreateCreditRequest(CreditRequestViewModel creditRequestViewModel)
        {
            var creditRequest = AutoMapper.Mapper.Map<CreditRequestViewModel, CreditRequest>(creditRequestViewModel);
            creditRequest.Status = CreditRequestStatus.AwaitingSecurityValidation;
            if (creditRequestViewModel.Attachments != null)
            {
                this.attachmentService.SaveAttachmentHeader(creditRequestViewModel.Attachments.ToList(), creditRequest);
            }

            creditUow.CreditRequests.InsertOrUpdate(creditRequest);
            creditUow.Commit();

            SendNotificationForNewCreditRequest(creditRequestViewModel, creditRequest.Id);

            return AutoMapper.Mapper.
                Map<CreditRequest, CreditRequestListItemViewModel>(creditUow.CreditRequests.GetFullCreditRequest(creditRequest.Id));
        }
 private void SendNotificationForNewCreditRequest(CreditRequestViewModel creditRequest, long id)
 {
     notificationService.SendNewCreditRequestCreated(creditRequest.ClientId.Value, creditRequest.ClientType, id.ToString());
 }
 public HttpResponseMessage CreateCreditRequest(CreditRequestViewModel creditRequest)
 {
     var creditItemViewModel = ProcessViewModel<CreditRequestViewModel, CreditRequestListItemViewModel>(creditRequest, creditRequestValidationService,
         creditRequestService.CreateCreditRequest);
     return Request.CreateResponse(HttpStatusCode.OK, creditItemViewModel);
 }