예제 #1
0
        public IEnumerable <T> QueryStoredProcedure <T>(string procedureName, params StoreParameter[] parameters)
        {
            var procBuilder = new StoredProcedureBuilder(procedureName, DataContext);

            procBuilder.AddParameters(parameters);
            return(DataContext.Query <T>(procBuilder.Build()));
        }
예제 #2
0
        public T SingleStoredProcedure <T>(string procedureName, params StoreParameter[] parameters)
        {
            var procBuilder = new StoredProcedureBuilder(procedureName, DataContext);

            procBuilder.AddParameters(parameters);
            return(DataContext.SingleOrDefault <T>(procBuilder.Build()));
        }
예제 #3
0
        public int ExecuteStoredProcedure(string procedureName, params StoreParameter[] parameters)
        {
            var procBuilder = new StoredProcedureBuilder(procedureName, DataContext);

            procBuilder.AddParameters(parameters);
            var _sql = procBuilder.Build();

            return(DataContext.Execute(_sql.SQL, CommandType.StoredProcedure, _sql.Arguments));
        }
예제 #4
0
        public DataTable QueryStoredProcedure(string procedureName, params StoreParameter[] parameters)
        {
            var procBuilder = new StoredProcedureBuilder(procedureName, DataContext);

            procBuilder.AddParameters(parameters);
            var sql   = procBuilder.Build();
            var items = DataContext.Fetch <Dictionary <string, object> >(sql);

            return(items.ToDataTable());
        }