using System; using System.Linq; using System.Threading.Tasks; using LCU.Library.Internal.CoreApiWrapperLib.Utilities; using LCU.Library.Internal.CoreApiWrapperLib.CoreApiUtilities; using LCU.Library.Internal.CoreApiWrapperLib.CoreDbUtilities; using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Associate; namespace LCU.Library.Internal.CoreApiWrapperLib.DataAccess { public class AssociateDao : BaseCoreDao, IAssociateDao { private const string GetAssociateDetailsBySsnQuery = "Associate/GetAssociateDetailsBySsnQuery"; private readonly ICoreDbExecution _coreDbExecution; public AssociateDao(ICoreRequest coreRequest, ICoreDbExecution coreDbExecution) : base(coreRequest) { _coreDbExecution = coreDbExecution; } public async Task GetAssociateDetailsBySsn(string taxId) { var query = QueryUtilities.GetQuery(GetAssociateDetailsBySsnQuery); var queryParameters = new { taxId = taxId }; return (await _coreDbExecution.ExecuteQuery(query, queryParameters)).FirstOrDefault(); } } }