Ejemplo n.º 1
0
 /// <summary>
 /// Creates a raw SQL query that will return elements of the given generic type.  The type can be any type that has properties that match the names of the columns returned from the query, or can be a simple primitive type. The type does not have to be an entity type. The results of this query are never tracked by the context even if the type of object returned is an entity type.
 /// </summary>
 /// <typeparam name="TElement">The type of object returned by the query.</typeparam>
 /// <param name="sql">The SQL query string.</param>
 /// <param name="parameters">The parameters to apply to the SQL query string.</param>
 /// <returns>Result</returns>
 public IEnumerable <TElement> SqlQuery <TElement>(string sql, params object[] parameters)
 {
     return(Database.SqlQuery <TElement>(sql, parameters));
 }
Ejemplo n.º 2
0
        public List <T> SqlQuery <T>(string query, params object[] param)
        {
            List <T> result = Database.SqlQuery <T>(query, param).ToList();

            return(result);
        }