using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using MMDAL.DTO.Collection; using MMDAL.Query.Collection; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace MMDAL.CustomCode.Collection { public class CollectionDAL : ICollectionDAL { private readonly IQueryExecutor _QueryExecutor; public CollectionDAL(IQueryExecutor QueryExecutor) { _QueryExecutor = QueryExecutor; } public async Task GetSelectListCollection(CriteriaDTO CriteriaDTO, LoginDTO LoginDTO) { try { string sql = CollectionQB.GET_SELECTLIST_COLLECTION; var parameters = new { }; IEnumerable result = await _QueryExecutor.QueryAsync(LoginDTO, sql, parameters); string json = JsonConvert.SerializeObject(result); return json; } catch (Exception ex) { throw new Exception($"Error in CollectionDAL.GetSelectListCollection: {ex.Message}", ex); } } } }