Pixata Custom Controls
For Lightswitch

Recent Posts

Popular tags (# posts in brackets)

Anonymous types (3) ASP.NET (5) C# (3) C# tricks and tips (2) Computers (6) Design patterns (3) DomainDataSource (3) Dynamic data (4) Entity framework (3) Entity model framework (5) F# (3) LightSwitch (12) Linq (6) Microsoft (2) MVP (2) MVVM (2) Project Euler (2) RIA services (5) Silverlight (2) SQL Server (4) Unit testing (4) Visual Studio (7) WCF (3) WPF (3)

Gratuitous link to StackExchange

Archives


Categories


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Actually, as I'm self-employed, I guess that means that any views I expressed here aren't my own. That's confusing!


Acknowledgments

Theme modified from one by Tom Watts
C#/F# code styling by Manoli (for posts pre-2016) and Google code prettify (for post from Jan 2016 and beyond)


My rambling thoughts on exploring the .NET framework and related technologies

RIA services are a great way to access your data from ASP.NET pages, but out of the box, they provide limited access to data not directly in the entity object itself. For example, an Action entity object (that holds information about an action that a user must do) will hold the ID of the user who has to do the action, but won''t hold the name of the user.

This post explains how you can extend the objects RIA passes back, without having to create new ones, or jump through hoops to do such a simple requirement. It also shows how to modify the Linq to include the information you want.

Sunday, 15 August 2010 18:59:11 (GMT Daylight Time, UTC+01:00)

Anonymous types are a common occurrence when using Linq queries, as you often return objects that don't correspond exactly to objects in the entity model.

The problem is that these anonymous types can only be used easily in the same code block as the one in which they were created. If you try and pass them into another block, or retrieve them in a data event of an ASP.NET Repeater control, you'll run into problems.

This post shows how to get around this problem quite easily, and how to give yourself strongly-typed entity objects that can be passed around.

Sunday, 15 August 2010 18:02:06 (GMT Daylight Time, UTC+01:00)