You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1013 B
33 lines
1013 B
using Dapper;
|
|
using DealerSelection.Common.Data.Dapper;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace WebJobService;
|
|
|
|
public class Repository : RepositoryBaseDapperAsync, IRepository
|
|
{
|
|
private readonly ILogger _logger;
|
|
public Repository(string cxnName, ILogger<Repository> logger) : base(cxnName)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public async Task<List<SelectedData>> GetDealerSelectionDataForJobAsync()
|
|
{
|
|
try
|
|
{
|
|
using SqlConnection cxn = await OpenCxnAsync();
|
|
IEnumerable<SelectedData> recordsToProcess = await cxn.QueryAsync<SelectedData>("DealerSelection.usp_get_dealer_selection_for_job",
|
|
commandType: CommandType.StoredProcedure);
|
|
return recordsToProcess.ToList();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_logger.LogError($"WJ:-Repo:-Error at Repository:GetDealerSelectionDataForJobAsync.", ex.StackTrace);
|
|
throw;
|
|
}
|
|
}
|
|
|
|
}
|