Skip to main content

Microsoft Silverlight

Answered Question "Provides Redundant Functionality" ErrorRSS Feed

(0)

alaskanrogue
alaskanr...

Member

Member

19 points

67 Posts

"Provides Redundant Functionality" Error

I am trying to extend a domain service by adding a new operation for Insert... But when I build, I get the following error "The domain operation entry named 'InsertWithPKUidContactInfo' provides redundant functionality. Another method named 'InsertContactInfo' already exists." Why should it matter, especially if it has a unique signature? I've added other extensions for Get... without problems.

I resorted to a separate operation because the "override" modifier generated the error "Type "xxxService' already defines a member called 'InsertContactInfo' with the same parameter types". How do you create a override?

Marc W. George
One Thought, One Message, "Live!"

prujohn
prujohn

Contributor

Contributor

3567 points

703 Posts

Answered Question

Re: "Provides Redundant Functionality" Error

RIAS enforces that a DomainService may have only one Insert, Update, Delete method for each entity type.  You can however, have multiple Query methods for the same entity type.  This is why you are able to add those Get... methods, but not the others.

You can abuse the Query methods though... such that they aren't being used for querys (so just returning null), and then perform some app logic inside of them.  Even this has limitations though, because you can't pass entity collections to query methods, only supported base type parameters (string, int, Guid, etc).

So you have to ask yourself "why do I need multipe Insert methods for the same enitity type?".   Perhaps you can explain your scenario requirements a bit more?

 

alaskanrogue
alaskanr...

Member

Member

19 points

67 Posts

Re: "Provides Redundant Functionality" Error

Thanks for replying.

Actually, I don't need two insert methods, just the modified one. I guess that I can comment out the generated version; mine are in  separate files.

Would the code analyser balk if the signature was different, i.e. two parameters instead of one, or is it looking at the actual call statement? 

Marc W. George
One Thought, One Message, "Live!"

prujohn
prujohn

Contributor

Contributor

3567 points

703 Posts

Re: "Provides Redundant Functionality" Error

Yes strict enforcement on the signatures.  It will throw a compile time error if you try to add anything other than one parameter for an Insert method, and that parameter must be a valid entity type.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities