DCSIMG
RIA - Shimmy on .NET

Browse by Tags

All Tags » RIA (RSS)

UniqueAttribute that validates a unique field against its fellow rows in the database (inherits DataAnnotations.ValidationAttribute) by Shimmy

UPDATE: Jan 30 2012 : Added check that entity is not itself (i.e. when user attempts to save the same entity). UPDATE: Feb 26 2012 : Added support for inherited entities, where the validated property is on the sub-class of the inheritance hierarchy. Here is a ValidationAttribute subclass that will allow you to validate that a column doesn't have duplicates. It's intended to be used with EF 4.1 DbContext , or with the EF4's ObjectContext . namespace System . ComponentModel . DataAnnotations...

TIP: Have the 'SILVERLIGHT' processor directive appear in intellisense in the ASP.NET host project (VB.NET) by Shimmy

Nothing special anyway, but I thought let's write it down briefly. In Silverlight solutions, especially when RIA Services is enabled, it's pretty common to use the SILVERLIGHT processor directive in the shared code and other. So the SILVERLIGHT directive is known in the Silverlight project, but in the ASP.NET there it doesn't appear in the intellisense, and since this is always valid, it's kinda error-prone when there is no intellisense support. To enable the intellisense simply open...

RequiredAttribute that validates collection fields by Shimmy

The System.ComponentModel.DataAnnotations namespace includes great classes for all that concerns validation and UI matters, for every .NET technology, especially ASP.NET MVC and Silverlight RIA Services . I think that the most used class of this namespace is the RequiredAttribute , that validates a field against nullity, or that a string should not be empty or whitespace. Today I created a class that has a List<T> (same applies to arrays, collections etc.) property, and I wondered if the RequiredAttribute...
Powered by Community Server (Commercial Edition), by Telligent Systems