private async Task SaveProvider(Roatp.Api.Types.Provider provider)
 {
     try
     {
         await _providerRepository.SaveProvider(provider);
     }
     catch (Exception ex)
     {
         _logger.Error(ex, $"Exception thrown saving Provider to RDS with Ukprn:{provider.Ukprn}");
         throw;
     }
 }
Пример #2
0
        public async Task SaveProvider(Roatp.Api.Types.Provider provider)
        {
            await WithConnection(async c =>
            {
                var parameters = new DynamicParameters();
                parameters.Add("@ukprn", provider.Ukprn, DbType.Int64);
                parameters.Add("@uri", provider.Uri, DbType.String);
                parameters.Add("@providerTypeId", provider.ProviderType, DbType.Int32);
                parameters.Add("@providerTypeDescription", provider.ProviderType.ToString());
                parameters.Add("@parentCompanyGuarantee", provider.ParentCompanyGuarantee, DbType.Boolean);
                parameters.Add("@newOrganisationWithoutFinancialTrackRecord", provider.NewOrganisationWithoutFinancialTrackRecord, DbType.Boolean);
                parameters.Add("@startDate", provider.StartDate, DbType.DateTime);

                return(await c.ExecuteAsync(
                           sql: "[Data_Load].[SaveProvider]",
                           param: parameters,
                           commandType: CommandType.StoredProcedure));
            });
        }