Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of alternate views in entity framework
Message
 
To
14/06/2011 15:20:37
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01513450
Message ID:
01514394
Views:
53
>>Kevin,
>>So I need to use a combination of the EDMX file and the standard business objects generated by the BLG? If I add the calculated property there, will it still be available when referencing the entity framework business object?
>>Linda
>>
>>>Linda,
>>>
>>>>I'm just getting started with the Entity Framework. I'm trying to figure out the best way to approach building a table that contains calculated columns. For example, I have a table that has monthly values and I would like to have an entity that contains the average values for a given quarter. I can certainly do this the "old-fashioned" way but I'd like to stick with the new model as much as possible. Do I need to create a view and add that to the EDMX, figure out the XML command and use theWCF or is there something I'm missing? Similarly, what's the new way to get a scalar value back?
>>>
>>>A good approach when creating a calculated property is to manually add the property to the other half of the entity that is auto-generated by the BLG.
>>>
>>>Best Regards,
>
>The entity framework business object has a reference to the Object context to retrieve data via the Entity Framework. You can add properties to the otherwise empty Entity class generated for you as Kevin mentioned. Check out the Dev Guide under the topic MM .NET Business Objects / Understanding Business Entity Objects / Entity Framework Entity Objects / Extending Entity Classes Generated by the Entity Data Model. In paticular the last paragraph at the bottom of that document.
>
>Timothy
Thanks, Tim. This will help me focus my homework time.
Linda Harmes
HiBit Technologies, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform