public async Task <ResponseModel> SaveStatusAsync(ApprovalProgressStatus model)
        {
            ResponseModel response  = new ResponseModel();
            var           newStatus = new ApprovalProgressStatus()
            {
                Status = model.Status
            };

            if (model.Status.Any())
            {
                dbContext.ApprovalProgressStatus.Add(newStatus);
                try
                {
                    dbContext.SaveChanges();
                    response.Message = "Saved Successfully";
                    response.Code    = 200;
                }
                catch (Exception ex)
                {
                    //Console.WriteLine($"Save Partner Status Error: {ex}");
                    response.Message = ex.Message;
                    response.Code    = 404;
                    dbContext.ApprovalProgressStatus.Local.Clear();
                    ErrorLog log = new ErrorLog();
                    log.ErrorDate       = DateTime.Now;
                    log.ErrorMessage    = ex.Message;
                    log.ErrorSource     = ex.Source;
                    log.ErrorStackTrace = ex.StackTrace;
                    dbContext.ErrorLogs.Add(log);
                    dbContext.SaveChanges();
                }
            }
            return(response);
        }
 public static void SeedApprovalProgressStatus(IApprovalProgressStatusRepository statusRepository)
 {
     string[] statusList = new string[] { "Approval In Progress", "Approved", "Declined", "Queried" };
     foreach (string status in statusList)
     {
         if (statusRepository.FindByNameAsync(status).Result == null)
         {
             ApprovalProgressStatus approval = new ApprovalProgressStatus()
             {
                 Status = status
             };
             try
             {
                 statusRepository.SaveStatusAsync(approval);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex);
             }
         }
     }
 }