Exemple #1
0
 Task <Guid> IRemitterDataAccess.SaveRemitter(RemitterModel model)
 {
     using (var db = new SymexDbContext())
     {
         db.Add <RemitterModel>(model);
         db.SaveChanges();
         return(Task.Run(() => model.ID));
     }
 }
        public async Task <IActionResult> ValidateKycSaga(RemitterModel remitter)
        {
            try
            {
                // Guid guid = await _remitterDataAccess.SaveRemitter(remitter);

                var endpoint = await _sendEndpointProvider.GetSendEndpoint(new Uri("queue:" + BusConfiguration.SagaQueue));

                await endpoint.Send <IAmlValidationEvent>(new
                {
                    RemitterID        = remitter.ID,
                    RemitterFirstName = remitter.FirstName,
                    RemitterLastName  = remitter.LastName,
                    RemitterCountry   = remitter.Country,
                    RemitterStatus    = remitter.Status,
                });

                return(Ok(remitter.ID));
            }
            catch (Exception ex)
            {
                return(Ok(ex.InnerException.Message));
            }
        }