Beispiel #1
0
        private List <FunderApiModel> MapFundersToApiModel(List <AllocationFunder> funders)
        {
            List <FunderApiModel> funderApiModels = new List <FunderApiModel>();

            try
            {
                var reportDate = DateTime.Now.ToString(_classConfiguration.DateFormat);
                foreach (var funder in funders)
                {
                    if (!string.IsNullOrEmpty(funder.FunderName))
                    {
                        FunderApiModel funderApi = MapFunderApi(reportDate, funder);
                        if (funderApi != null)
                        {
                            funderApiModels.Add(funderApi);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Error();
            }
            return(funderApiModels);
        }
Beispiel #2
0
        private FunderApiModel MapFunderApi(string reportDate, AllocationFunder funder)
        {
            FunderApiModel funderApi = null;

            try
            {
                funderApi = new FunderApiModel
                {
                    CustomerId         = _classConfiguration.CustomerId,
                    ExternalUploadDate = reportDate,
                    Name       = funder.FunderName,
                    ReportDate = reportDate,
                    Type       = funder.FunderType.ToString(),
                    Uid        = funder.FunderName
                };
            }
            catch (Exception ex)
            {
                throw;
            }
            return(funderApi);
        }