I was trying to add some validation logic into one of my forms. I added a function to my domain data service that I wanted to call from my Silverlight application using an [Invoke] attribute.
It all looked good but every time I tried to call it I kept getting an an error:
Invoice operation [functionname] failed validation. Please inspect ValidationErrors on the operation for details
After pulling my hair out for a bit I realised the entity I was passing into the function was getting validated and ValidationErrors were getting set. This is somewhat annoying.
To get around this for now, what I’ve done is change my function from:
public bool IsLayerNameUnique(Entity myEntity)
to pass the fields that i need instead e.g.
[Invoke] This now means I can run the function but is somewhat annoying. If I needed to validate a bunch of fields it would mean I’d have to pass them all in. Anyone got a better way to do this?
public bool IsLayerNameUnique(string name, Guid id)