示例#1
0
        protected U ExecuteSingle <U>(string command = null, object param = null)
        {
            U           result   = default(U);
            IDBProvider provider = new MSSQLDBProvider();

            if (!string.IsNullOrEmpty(command))
            {
                this.command = command;
            }
            using (var conn = provider.GetDBConnection())
            {
                result = conn.Query <U>(this.command, param).SingleOrDefault();
            }
            return(result);
        }
示例#2
0
        protected IQueryable <U> ExecuteQuery <U>(string command = null, object param = null)
        {
            IQueryable <U> result   = null;
            IDBProvider    provider = new MSSQLDBProvider();

            if (!string.IsNullOrEmpty(command))
            {
                this.command = command;
            }
            using (var conn = provider.GetDBConnection())
            {
                result = conn.Query <U>(this.command, param).AsQueryable <U>();
            }
            return(result);
        }