Print Page | Close Window

EntityServerSaveInterceptor - How

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4101
Printed Date: 25-Mar-2025 at 12:38pm


Topic: EntityServerSaveInterceptor - How
Posted By: mrbillo
Subject: EntityServerSaveInterceptor - How
Date Posted: 07-Apr-2013 at 11:29am

I need to override the EntityServerSaveInterceptor. I don't understand where to do this. I have three projects:

Business Logic - Provides data from the Entity Model to the WebService

EntityModel - contains only entities

WebService - web service that using the Business Logic project to provide data
 
When I create the entity manager I set this property  this.VerifierEngine.DefaultVerifierOptions.ShouldTreatEmptyStringAsNull = false. This does not work for the server validation so I created the class below to do this.
Which project do I put this class in and how do I override the server code ?

 public class mnstSaveInterceptor : EntityServerSaveInterceptor 
    {
        protected override bool ValidateSave() {
            this.VerifierEngine.DefaultVerifierOptions.ShouldTreatEmptyStringAsNull = false;
            return base.ValidateSave();
        }
    }

TIA Bill



Replies:
Posted By: gregweb
Date Posted: 07-Apr-2013 at 12:51pm
Hi Bill,

Just put the class as you wrote it in your server side project and it will be found automatically by DevForce during it's discovery process and used. In other words, you don't need to do anything further in order for your ValidateSave code to run.

Greg




Posted By: mrbillo
Date Posted: 07-Apr-2013 at 5:19pm
Worked great, thanks



Print Page | Close Window