ObjectQuery.GetResultType Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns information about the result type of the query.
public:
System::Data::Metadata::Edm::TypeUsage ^ GetResultType();
public System.Data.Metadata.Edm.TypeUsage GetResultType ();
member this.GetResultType : unit -> System.Data.Metadata.Edm.TypeUsage
Public Function GetResultType () As TypeUsage
Returns
A TypeUsage value that contains information about the result type of the query.
Examples
This example creates an ObjectQuery<T> of type DbDataRecord and uses GetResultType to determine whether the type returned represents a row.
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
string queryString = @"SELECT VALUE product "
+ "FROM AdventureWorksEntities.Products AS product";
ObjectQuery<DbDataRecord> query =
new ObjectQuery<DbDataRecord>
(queryString, context);
TypeUsage type = query.GetResultType();
if (type.EdmType is RowType)
{
RowType row = type.EdmType as RowType;
foreach (EdmProperty column in row.Properties)
Console.WriteLine("{0}", column.Name);
}
}
Applies to
See also
Vertu í samstarfi við okkur á GitHub
Heimildina fyrir þetta efni er að finna á GitHub, þar sem þú getur líka búið til og farið yfir vandamál og sameinað beiðnir. Frekari upplýsingar er að finna í framlagshandbók okkar.