/// <summary>
        /// Executes the specified stored procedure against a database.
        /// </summary>
        /// <param name="context">The ObjectContext to execute against.</param>
        /// <param name="storedProcedure">The stored procedure to execute.</param>
        public static void ExecuteStoredProcedure(this ObjectContext context, object storedProcedure)
        {
            if (storedProcedure == null)
            {
                throw new ArgumentNullException("storedProcedure");
            }

            var info = StoredProcedureParser.BuildStoredProcedureInfo(storedProcedure);

            context.ExecuteStoreCommand(info.Sql, info.SqlParameters);

            SetOutputParameterValues(info.SqlParameters, storedProcedure);
        }
        /// <summary>
        /// Executes the specified stored procedure against a database
        /// and returns an enumerable of T representing the data returned.
        /// </summary>
        /// <typeparam name="T">Type of the data returned from the stored procedure.</typeparam>
        /// <param name="context">The ObjectContext to execute against.</param>
        /// <param name="storedProcedure">The stored procedure to execute.</param>
        /// <returns></returns>
        public static IEnumerable <T> ExecuteStoredProcedure <T>(this ObjectContext context, object storedProcedure)
        {
            if (storedProcedure == null)
            {
                throw new ArgumentNullException("storedProcedure");
            }

            var info = StoredProcedureParser.BuildStoredProcedureInfo(storedProcedure);

            IEnumerable <T> result = context.ExecuteStoreQuery <T>(info.Sql, info.SqlParameters);

            SetOutputParameterValues(info.SqlParameters, storedProcedure);

            return(result);
        }
        /// <summary>
        /// Executes the specified stored procedure against a database
        /// and returns an enumerable of T representing the data returned.
        /// </summary>
        /// <typeparam name="T">Type of the data returned from the stored procedure.</typeparam>
        /// <param name="database">The database to execute against.</param>
        /// <param name="storedProcedure">The stored procedure to execute.</param>
        /// <returns></returns>
        public static IEnumerable <T> ExecuteStoredProcedure <T>(this Database database, object storedProcedure)
        {
            if (storedProcedure == null)
            {
                throw new ArgumentNullException("storedProcedure");
            }

            var info = StoredProcedureParser.BuildStoredProcedureInfo(storedProcedure);

            List <T> result = database.SqlQuery <T>(info.Sql, info.SqlParameters).ToList();

            SetOutputParameterValues(info.SqlParameters, storedProcedure);

            return(result);
        }