AliasedValue Class
Updated: November 29, 2016
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Used to return aggregate, group by, and aliased values from a query.
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
| Name | Description | |
|---|---|---|
![]() | AliasedValue() | Initializes a new instance of the AliasedValue class. |
![]() | AliasedValue(String, String, Object) | Initializes a new instance of the AliasedValue class. |
| Name | Description | |
|---|---|---|
![]() | AttributeLogicalName | Gets the name of the attribute on which the aggregate, group by, or select operation was performed. |
![]() | EntityLogicalName | Gets the name of the entity the attribute belongs to. |
![]() | ExtensionData | Gets or sets the structure that contains extra data. |
![]() | Value | Gets the value returned by the query. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
// Fetch the average of estimatedvalue for all opportunities. This is the equivalent of // SELECT AVG(estimatedvalue) AS estimatedvalue_avg ... in SQL. System.Console.WriteLine("==============================="); string estimatedvalue_avg = @" <fetch distinct='false' mapping='logical' aggregate='true'> <entity name='opportunity'> <attribute name='estimatedvalue' alias='estimatedvalue_avg' aggregate='avg' /> </entity> </fetch>"; EntityCollection estimatedvalue_avg_result = _serviceProxy.RetrieveMultiple(new FetchExpression(estimatedvalue_avg)); foreach (var c in estimatedvalue_avg_result.Entities) { decimal aggregate1 = ((Money)((AliasedValue)c["estimatedvalue_avg"]).Value).Value; System.Console.WriteLine("Average estimated value: " + aggregate1); }
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright

