Archives
-
General Purpose Data Annotations Validation Attribute
The Data Annotations framework, introduced in .NET 3.5, and enhanced in .NET 4.0, is likely becoming the basis for attribute-based validation in .NET. I like about it the fact that it is extensible and that it can be (and indeed it is) used in a lot of scenarios, from Silverlight to ASP.NET MVC and Dynamic Data.
-
Evento Introdução ao SharePoint 2010
No dia 25 de Fevereiro vai ter lugar em Leiria mais um evento organizado pelo Grupo de Utilizadores do SharePoint 2010 de Leiria, com o apoio da Galileu.
-
Changing a Control’s Output Dynamically
A question that pops up occasionally in ASP.NET forums or sites like Stack Overflow is how to change a control’s output dynamically. Well, since the CSS Friendly Control Adapters came out, I knew how to do it statically, through static registration on a .browser file (it can also be done dynamically, for all controls of a certain type, by adding a fully qualified type name to HttpContext.Current.Request.Browsers.Adapters collection), but I decided to go and try to do it dynamically, without registration. More specifically, I wanted to achieve two things:
-
NHibernate Metadata
I know that O/RMs like NHibernate are supposed to shield us from the gory database internals such as tables, views, columns and such; however, at times, I do have the need to know how my domain model translates to the database. NHibernate, of course, provides us with the information we need, but it isn’t always easy to find, so I wrote my own extension methods for ISessionFactory that allow me to get the metadata I need in an easy way: