예제 #1
0
        public SqlCommand Command(string CommandText)
        {
            SqlConnection connection = new SqlConnection(SqlConnectionString.ConnectionString());
            SqlCommand    command    = new SqlCommand();

            command.CommandText = CommandText;
            command.CommandType = CommandType.StoredProcedure;
            command.Connection  = connection;

            return(command);
        }
예제 #2
0
        public IEnumerable <Products> FindProductsByCategoryID(int CategoryID)
        {
            IDbConnection connection = new SqlConnection(SqlConnectionString.ConnectionString());

            return(connection.Query <Products>("dbo.FindProductsByCategoryID", new { @CategoryID = CategoryID }, commandType: CommandType.StoredProcedure));
        }