CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

David Hayden [MVP C#]

         .NET Tutorials, Patterns, and Practices

EntLib 4.0 Validation Application Block and Unity Screencast

In my last screencast I talked about integrating the Data Access Application Block with Unity:

In the following screencast on the Validation Application Block in Enterprise Library 4.0:

we don't need to discuss Unity Extensions like in the previous screencast, because we can get really nice injection of validator classes, such as IValidator<Customer>, into our custom classes by creating a simple wrapper around the Validation Application Block and registering the wrapper with Unity.

The screencast shows how to create a simple wrapper around the Validation Application Block, register it with Unity.RegisterType, access the custom validator classes via Unity.Resolve, and have Unity inject those validator classes into custom classes, such as an AddCustomerPresenter Class. The same techniques will work if you are using the ASP.NET MVC Framework and injecting validator classes into a Controller.

For more information on the Validation Application Block:

You can also check out my Unity Dependency Injection Screencasts:

 

Thanks for all the positive feedback on the previous screencast :) Enjoy!

David Hayden



Check out Devlicio.us!

Our Sponsors

This Blog

Syndication

News

CodeBetter.Com Home