Пример #1
0
        public virtual (List <M>, bool) GetAll <M>(params string[] column) where M : class, new()
        {
            string cmtext = query.GetAll <M>(column);

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.Reader <M>(cmtext));
        }
Пример #2
0
        public virtual List <T> GetAll(params string[] column)
        {
            string cmtext = query.GetAll(column);

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.Reader <T>(cmtext));
        }
Пример #3
0
        public virtual List <T> getFromTo(int from, int to)
        {
            string cmtext = query.getFromTo(from, to);

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.Reader <T>(cmtext));
        }
Пример #4
0
        public virtual (List <M>, bool) GetWithCondition <M>(string condition, params string[] selectColumn) where M : class, new()
        {
            string cmtext = query.Condition <M>(condition, selectColumn);

            using (CommanderBase commander = DBContext.CreateCommander())
            {
                return(commander.Reader <M>(cmtext));
            }
        }
Пример #5
0
        public virtual List <T> getFromToWithSrc(int from, int to, string srcClm, string srcValue)
        {
            string cmtext = query.getFromToWithSrc(from, to, srcClm);

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.Reader <T>(cmtext, new List <DbParameter> {
                    commander.SetParametr(srcClm, srcValue)
                }));
        }
Пример #6
0
        public virtual List <T> GetByColumName(string columName, object value)
        {
            string cmtext = query.GetByColumName(columName);

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.Reader <T>(cmtext, new List <DbParameter>()
                {
                    commander.SetParametr(columName, value)
                }));
        }
Пример #7
0
        public virtual (List <M>, bool) GetByColumName <M>(string columName, object value, params string[] selectColumn) where M : class, new()
        {
            string cmtext = query.GetByColumName <M>(columName, selectColumn);

            using (CommanderBase commander = DBContext.CreateCommander())
            {
                return(commander.Reader <M>(cmtext, new List <DbParameter>()
                {
                    commander.SetParametr(columName, value)
                }));
            }
        }