New Posts New Posts RSS Feed: EntityServerSaveInterceptor - How
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

EntityServerSaveInterceptor - How

 Post Reply Post Reply
Author
mrbillo View Drop Down
Newbie
Newbie


Joined: 11-May-2012
Location: Belleville, MI
Posts: 2
Post Options Post Options   Quote mrbillo Quote  Post ReplyReply Direct Link To This Post Topic: EntityServerSaveInterceptor - How
    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
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
mrbillo View Drop Down
Newbie
Newbie


Joined: 11-May-2012
Location: Belleville, MI
Posts: 2
Post Options Post Options   Quote mrbillo Quote  Post ReplyReply Direct Link To This Post Posted: 07-Apr-2013 at 5:19pm
Worked great, thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down