CodeSmith Community
Your Code. Your Way. Faster!

Custom validation rules at the service level - can be easier to implement

Latest post 02-22-2008 5:25 PM by fweeee. 0 replies.
  • 02-22-2008 5:25 PM

    • fweeee
    • Top 25 Contributor
    • Joined on 08-08-2007
    • Posts 191
    • Points 4,748

    Custom validation rules at the service level - can be easier to implement

    Custom validation rules are easy enough to add at the Entity level (that is, in the Entity.cs file). But when more complex validation rules are required, which need to look at other records in the database (either the same table or other tables), the validation rules need to be added at the service layer (in the EntityService.cs file).

    For me, at the moment, the steps are:

    1) Create method in the EntityService.cs to add custom validation rules to entity

    2) Create overrides for each Get method in the service (or at least those I think I'm going to use).

    This is rather combersum, and causes problems when I leave a get override out which I later use.

    Is it possible to make it so that custom validation rules in the service layer are automatically added to all Get methods? 

    • Post Points: 5
Page 1 of 1 (1 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems