Ejemplo n.º 1
0
        public async Task <IList <Certificate360> > Certificate360Filter(Certificate360Filter filter)
        {
            var tPremiseIDs = new DataTable();

            tPremiseIDs.Columns.Add("Val", typeof(long));

            if (filter.PremiseIDs?.Any() ?? false)
            {
                foreach (var id in filter.PremiseIDs)
                {
                    tPremiseIDs.Rows.Add(id);
                }
            }

            var param = new DynamicParameters();

            param.Add("@PremiseIDs", tPremiseIDs.AsTableValuedParameter("dbo.BigIntType"));

            var mapper = new Certificate360Mapper();

            return((await SqlMapper.QueryAsync <Certificate360>(_unitOfWork.Connection,
                                                                "SelectCertificate360",
                                                                new[]
            {
                typeof(Certificate360),
                typeof(Premise),
                typeof(Menu)
            },
                                                                obj =>
            {
                return mapper.Map(obj[0] as Certificate360,
                                  obj[1] as Premise,
                                  obj[2] as Menu);
            },
                                                                param,
                                                                splitOn: "ID,PremID,MenuID",
                                                                commandType: CommandType.StoredProcedure,
                                                                transaction: _unitOfWork.Transaction)).Distinct().ToList());
        }
Ejemplo n.º 2
0
 public SelectCertCommand(Certificate360Filter filter)
 {
     _filter = filter;
 }
Ejemplo n.º 3
0
 public async Task <IList <Model.Certificate360> > GetCertificates(Certificate360Filter filter)
 {
     return(await Execute(new SelectCertCommand(filter)));
 }