ObjectParameter.ParameterType Property
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.
Gets the parameter type.
public:
property Type ^ ParameterType { Type ^ get(); };
public Type ParameterType { get; }
member this.ParameterType : Type
Public ReadOnly Property ParameterType As Type
Property Value
The Type of the parameter.
Examples
This example adds new parameters to the collection. It iterates through the ObjectParameterCollection and displays the name, type, and value of each parameter in the collection.
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
string queryString =
@"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.LastName = @ln
AND contact.FirstName = @fn";
ObjectQuery<Contact> contactQuery =
new ObjectQuery<Contact>(queryString, context);
// Add parameters to the collection.
contactQuery.Parameters.Add(new ObjectParameter("ln", "Adams"));
contactQuery.Parameters.Add(new ObjectParameter("fn", "Frances"));
ObjectParameterCollection objectParameterCollection =
contactQuery.Parameters;
// Iterate through the ObjectParameterCollection.
foreach (ObjectParameter result in objectParameterCollection)
{
Console.WriteLine("{0} {1} {2}", result.Name,
result.Value,
result.ParameterType);
}
}
Remarks
The parameter type can only be set through a constructor.
Applies to
See also
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για