Summary 09.08.2009 – 11.08.2009

11/08/2009

ASP.NET MVC

Simone Chiaretta dissects the DropDownList helper method.

David Hayden continues his post from yesterday showing how we can separate the validation annotations into a metadata class via BuddyMetadataProvider similar to how DynamicData works.

C#

Daniel Cazzulino shows how to achieve strongly typed reflection for generic types and methods by creating a delegate of the target method and using the delegate’s properties to get the corresponding MethodInfo.

The CLR team talks about IL Stubs Everywhere feature in C# 4.0 that allows the same IL stubs infrastructure for all marshalling on all platforms.

Bart DeSmet presents the new System.Linq.Expressions namespace in C# 4.0.

Design patterns

Jeremy Miller announces that the presentation patterns wiki is live!

DDD

Jonathan Oliver has an excellent post about distributing a single bounded context on different machines and dealing with optimistic concurrency.

Entity Framework

Julie talks about entity properties that we can take advantage of in EF 4.0 and that are designed for model first and dynamic data support.

RIA

Fredrik Normen shows how SubmitChanges mechanism works in .NET RIA Services.

Unity

Mike Taulty has a nice post about Unity’s features.

Shout it

kick it on DotNetKicks.com

Advertisements

Summary 07.08.2009 – 08.08.2009

10/08/2009

ASP.NET MVC

David Hayden shows how the support for System.ComponentModel.DataAnnotations in DefaultModelBinder works in ASP.NET MVC 2.0 Preview 1.

Entity Framework

Julie Lerman talks about code only support and query improvements in EF 4.0.

Alex James talks about structural annotations.

MEF

Bart DeSmet has an excellent introductory post about MEF.

Shout it

kick it on DotNetKicks.com


Summary 06.08.2009

07/08/2009

Entity Framework

In the latest MSDN Magazine, David Simmons talks about N-Tier Application Patterns and Tim Mallalieu talks about Data Access Architecture Best Practices.

Simon Seagal has an interesting post about fetching strategies in EF 4.0. Also Alex James has a nice post about implementing fetching strategies.

Mattieu Mezil show how to use TypeDescriptors to make FK work in EF 1.0.

In his 30th tip, Alex James shows how to use database functions in EF 1.0 and EF 4.0.

The ADO.NET team presents the improvements to the generated SQL for Entity Framework.

ASP.NET MVC

Phil Haacked shows how to focus in View pages on presentation concerns by moving Page declaration to web.config. He also shows a prototype of default templated views that we might have in the future bits of MVC.

C#

Kirill Osenkov points out the C# compiler team blogs.

Chris Burrows has a nice post about dynamic base classes.

Eric Lippert has another bunch of excellent articles:


Learning resources for ASP.NET 4.0 WebForms new features

06/08/2009

After sharing the C# 4.0, EF 4.0 learning resources, I thought posting the resources for ASP.NET 4.0 WebForms.

General

http://videos.visitmix.com/MIX09/T46F

http://channel9.msdn.com/shows/The+Knowledge+Chamber/Stephen-Walther-New-Features-of-ASPNET-40/

http://blogs.msdn.com/publicsector/archive/2009/03/25/devdinnerondemand-what-s-new-in-asp-net-4-0.aspx

http://blogs.msdn.com/scothu/archive/2009/03/23/asp-net-4-0-and-visual-studio-2010-development-overview-dynamic-data.aspx

http://www.asp.net/learn/whitepapers/aspnet40/

http://haacked.com/archive/2008/11/13/future-of-aspnet.aspx

WebForms

http://blogs.msdn.com/mikeormond/archive/2009/05/06/asp-net-4-0-webforms-enhancements.aspx

http://channel9.msdn.com/shows/10-4/10-4-Episode-3-ASPNET-WebForms-40/

http://mostlylucid.net/archive/2009/01/01/asp.net-4.0-webforms-podcast-is-now-up.aspx

http://blogs.msdn.com/mikeormond/archive/2009/04/16/visual-studio-2010-enhancements-for-asp-net.aspx

http://mostlylucid.net/archive/2009/01/29/1313.aspx

Client ID

http://mostlylucid.net/archive/2008/11/03/way-too-much-information-on-control-ids-and-asp.net-4.0.aspx

http://blog.osbornm.com/archive/2009/01/06/asp.net-4.0-clientid-overview-again.aspx

ViewState

http://weblogs.asp.net/despos/archive/2009/06/13/asp-net-4-0-more-control-on-viewstate-management.aspx

http://mostlylucid.net/archive/2009/01/28/1312.aspx

Data Controls

http://blogs.msdn.com/mikeormond/archive/2009/06/29/asp-net-4-0-enhancements-to-data-controls.aspx

http://csharpbits.notaclue.net/2009/03/cascading-or-dependant-field-templates.html

Routing

http://mostlylucid.net/archive/2009/05/19/1322.aspx

http://mostlylucid.net/archive/2009/01/25/asp.net-4.0-webform-routing-quick-rsquon-dirty-version.aspx

http://haacked.com/archive/2009/01/25/routing-for-web-forms-in-asp.net-4.0.aspx

Dynamic Images

http://www.hanselman.com/blog/ASPNETFuturesGeneratingDynamicImagesWithHttpHandlersGetsEasier.aspx

http://blogs.msdn.com/scothu/archive/2008/08/21/image-generation-is-released-to-codeplex.aspx

http://davidhayden.com/blog/dave/archive/2008/08/27/ASPNETImageGenerationGenerateImagesGetImagesDatabaseTransformImages.aspx

http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16449

Control Adapters

http://mostlylucid.net/archive/2009/04/27/1319.aspx

Testing

http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28536

Enjoy,

Bogdan

kick it on DotNetKicks.com

Shout it


Summary 05.08.2009

05/08/2009

DDD

Jan Van Ryswyck talks about fluent domain methods for setting up complex aggregate roots and for implementing behavior on domain entities.

Alex James also shows how to work with fluent interfaces and how to use fluent interfaces with extension methods.

Jérémie Chassaing shows how Service Bus pattern can help in DDD with code reusability.

Ayende talks about decomposing an application into features as a way for separating different application functionality and to allow independent development.

Entity Framework

Julie Lerman shows how in EF 4.0 the function mapping feature is improved as the conceptual space also gets the function allowing it to be called from the entity directly and not through EntityClient. She also points out a bug when using T4 template instead of EntityModelCodeGenerator for CustomTool mode. Another great article is about the major improvements in EF 4.0 for working with complex types.

The Entity Framework Design team talks about the Code Only enhancements that will be available in the next release.

Alex James how to use T4 templates for generating entities that have regular expressions applied to them. He also continues his tips series :

Tip 27 – How to Implement BeforeSave Validation

Tip 28 – How to implement an Eager Loading strategy

Tip 29 – How to avoid LazyLoad or Load() reader issues

Design Patterns

Don Smith has an excellent about the usage of Model View ViewModel (MVVM) pattern and how to cleanly separate the View from the ViewModel in different scenarios including data bindings, animations, commands and parameters.

Architecture

Sean Chambers has a great series about code refactoring.

T4

Oleg Sych talks about the customization of the TFS Process Guidance with T4.

Shout it

kick it on DotNetKicks.com


Learning resources for Entity Framework 4.0 new features

05/08/2009

The learning resources for C# 4.0 proved to very useful for many people so I thought about doing the same thing for EF 4.0.

New features

http://blogs.msdn.com/adonet/archive/2009/05/21/updated-entity-framework-documentation-for-beta1.aspx

http://blogs.msdn.com/adonet/archive/2009/06/22/announcing-entity-framework-feature-ctp-1.aspx

http://blog.tonysneed.com/?p=161

http://www.develop.com/entityframework4

SQL improvements

http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx

http://thedatafarm.com/blog/data-access/important-entity-framework-query-improvements-for-net-4-0/

POCO Objects

http://msdn.microsoft.com/en-us/magazine/ee236639.aspx

http://blogs.msdn.com/adonet/archive/2009/05/11/sneak-preview-persistence-ignorance-and-poco-in-entity-framework-4-0.aspx

http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx

http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx

http://blogs.msdn.com/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx

http://mosesofegypt.net/post/Entity-Framework-4-Persistence-Ignorance-First-Look.aspx

Deferred Loading and Explicit Loading

http://blogs.msdn.com/adonet/archive/2009/05/12/sneak-preview-deferred-loading-in-entity-framework-4-0.aspx

http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx

http://thedatafarm.com/blog/data-access/a-look-at-lazy-loading-in-ef4/

http://www.simonsegal.net/blog/2009/07/27/entity-framework-40-improvements/

http://www.simonsegal.net/blog/2009/07/29/entity-framework-40-and-fetching-strategies/

Functions in LINQ to Entities

http://thedatafarm.com/blog/data-access/checking-out-one-of-the-new-stored-procedure-features-in-ef4/

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/05/23/calling-database-functions-in-linq-to-entities-in-entity-framework-4.aspx

Tip 30 – How to use a custom database function

Model Defined Functions

http://blogs.msdn.com/adonet/archive/2009/05/14/sneak-preview-model-defined-functions.aspx

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/05/23/calling-database-functions-in-linq-to-entities-in-entity-framework-4.aspx

http://thedatafarm.com/blog/data-access/ef4-model-defined-functions-level-1-amp-2/

EDM Designer

http://msdn.microsoft.com/en-us/library/dd456821(VS.100).aspx

Model-First Support

http://msdn.microsoft.com/en-us/magazine/ee236639.aspx

http://blogs.msdn.com/adonet/archive/2009/05/12/sneak-preview-model-first-in-the-entity-framework-4-0.aspx

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/05/23/model-first-in-entity-framework-4.aspx

http://channel9.msdn.com/shows/10-4/10-4-Episode-15-Model-First-Development-with-the-Entity-Framework-40/

http://thedatafarm.com/blog/data-access/ef4-ndash-new-properties-for-entity-properties/

Code Only Support

http://blogs.msdn.com/efdesign/archive/2009/06/10/code-only.aspx

http://blogs.msdn.com/adonet/archive/2009/06/22/feature-ctp-walkthrough-code-only-for-entity-framework.aspx

http://blogs.msdn.com/efdesign/archive/2009/08/03/code-only-enhancements.aspx

http://blogs.msdn.com/alexj/archive/2009/08/12/tip-32-how-to-create-a-database-from-ssdl-ef-4-only.aspx

Complex Type Support

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/05/22/complex-type-support-in-the-edm-designer-in-entity-framework-4.aspx

http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx

http://thedatafarm.com/blog/data-access/a-big-step-for-stored-procedures-in-ef4/

http://thedatafarm.com/blog/data-access/complex-types-in-the-edm-designer-in-ef4-and-a-look-at-updating-complex-types-in-code/

Table splitting

http://thedatafarm.com/blog/data-access/ef-table-splitting-ndash-the-opposite-of-entity-splitting/

Testability

http://blogs.msdn.com/adonet/archive/2009/05/18/sneak-preview-entity-framework-4-0-testability-improvements.aspx

Design patterns

http://msdn.microsoft.com/en-us/magazine/ee236639.aspx

http://blog.keithpatton.com/2009/05/30/Entity+Framework+POCO+Repository+Using+Visual+Studio+2010+Net+40+Beta+1.aspx

http://blogs.msdn.com/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx

http://thedatafarm.com/blog/data-access/another-clever-pattern-for-dealingi-wtih-ef-change-tracking-across-processes/

Events

http://romiller.com/Home/tabid/36/EntryID/51/Default.aspx

Architecture

http://blogs.msdn.com/adonet/archive/2009/05/14/sneak-preview-n-tier-development-with-entity-framework-4-0.aspx

http://msdn.microsoft.com/en-us/magazine/ee321569.aspx

Self tracking entities

http://blogs.msdn.com/adonet/archive/2009/05/14/sneak-preview-n-tier-development-with-entity-framework-4-0.aspx

http://msdn.microsoft.com/en-us/magazine/ee321569.aspx

http://blogs.msdn.com/efdesign/archive/2009/03/24/self-tracking-entities-in-the-entity-framework.aspx

http://blogs.msdn.com/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx

http://blogs.msdn.com/adonet/archive/2009/06/22/feature-ctp-walkthrough-self-tracking-entities-for-entity-framework.aspx

http://weblogs.asp.net/gunnarpeipman/archive/2009/07/11/entity-framework-4-0-how-to-use-pocos.aspx

POCO T4 templates

http://msdn.microsoft.com/en-us/magazine/ee236639.aspx

http://thedatafarm.com/blog/data-access/ef-why-work-with-objectstateentries-instead-of-the-objects-directly/

http://thedatafarm.com/blog/data-access/customizing-edm-code-gen-in-ef4/

http://thedatafarm.com/blog/data-access/small-ef4-wpf-bug-that-bit-me-in-the-butt-during-my-vtdotnet-presentation/

 http://blogs.msdn.com/adonet/archive/2009/05/19/sneak-peek-using-code-generation-templates-with-the-entity-framework-4-0.aspx

http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx

http://blogs.msdn.com/adonet/archive/2009/06/22/feature-ctp-walkthrough-poco-templates-for-entity-framework.aspx

http://msmvps.com/blogs/matthieu/archive/2009/06/26/poco-t4.aspx

http://blogs.msdn.com/adonet/archive/2009/07/22/customizing-t4-templates.aspx

Validation

http://blogs.msdn.com/alexj/archive/2009/07/20/tip-27-how-to-implement-beforesave-validation.aspx

EDM designer

http://thedatafarm.com/blog/data-access/more-designer-improvements-deleting-entities-from-the-model-and-from-the-store-schema/

Foreign keys

http://blogs.msdn.com/efdesign/archive/2009/03/16/foreign-keys-in-the-entity-framework.aspx

Pluralization

http://blogs.msdn.com/efdesign/archive/2008/12/02/pluralization.aspx

http://blogs.msdn.com/adonet/archive/2009/05/20/sneak-preview-pluralization-in-entity-framework-4-0.aspx

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/05/22/pluralize-or-singularize-generated-object-names-checkbox-in-entity-framework-4.aspx

Tips

Tip 32 – How to create a database from SSDL – EF 4 only

Tip 31 – How to compose L2O and L2E queries

Tip 30 – How to use a custom database function

Tip 29 – How to avoid LazyLoad or Load() reader issues

Tip 28 – How to implement an Eager Loading strategy

Tip 27 – How to Implement BeforeSave Validation

Tip 26 – How to avoid database queries using Stub Entities

Tip 25 – How to get Entities by key the easy way

Tip 24 – How to get the ObjectContext from an Entity

Tip 23 – How to fake Enums in EF 4

Tip 22 – How to make Include really Include

Tip 21 – How to use the Single() operator – EF 4.0 only

Tip 20 – How to deal with Fixed Length Keys

Tip 19 – How to use Optimistic Concurrency with the Entity Framework

Tip 18 – How to decide on a lifetime for your ObjectContext

Tip 17 – How to do one step updates with AttachAsModified(..)

Tip 16 – How to mimic .NET 4.0’s ObjectSet<T> today

Tip 15 – How to avoid loading unnecessary Properties

Tip 14 – How to cache Entity Framework Reference Data

Tip 13 – How to Attach an Entity the easy way

Tip 12 – How to choose an Inheritance Strategy

Tip 11 – How to avoid Relationship Span

Tip 10 – How to understand Entity Framework jargon

Tip 9 – How to delete an object without retrieving it

Tip 8 – How to write ‘WHERE IN’ style queries using LINQ to Entities

Tip 7 – How to fake Foreign Key Properties in .NET 3.5 SP1

Tip 6 – How and when to use eager loading

Tip 5 – How to restrict the types returned from an EF Query

Tip 4 – Conceptual Schema Definition Language Rules

Tip 3 – How to get started with T4

Tip 2 – Entity Framework Books

Tip 1 – How to sort Relationships in the Entity Framework

Enjoy,

Bogdan

kick it on DotNetKicks.com

Shout it


MSBuild error “C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1993,9): error MSB3091: Task failed because “sgen.exe” was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for “sgen.exe” in the “bin” subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5. 2) Install Visual Studio 2008. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the “ToolPath” parameter of the task.”

04/08/2009

I fought for a couple of minutes with this error and I thought to share with you my solution.

The error was on my build machine which wasn’t having Windows SDK and I wasn’t planning to install it either.

I was having HKLM\SOFTWARE\Microsoft\Microsoft SDKs\.NETFramework\v2.0 key and the InstallationFolder key with the value C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\ so I thought about adding the key that was normally generated by Windows SDK.

So, I added HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A key with the InstallationFolder key pointing to the same value as above and copied the missing sgen.exe into the bin\ folder under the above mention location.

I queued a new build a everything worked like a charm.

I hope this helps,
Bogdan