views:

22

answers:

1

EF + WCF Ria Service: Suppose I have entity People, because it is a partial class, so I can extend it to add a method to it:

partial class People{
  static string GetMyString(){
     //......
     return string;
  }
}

then at client side, I want to method GetMyString available for entity People. what's the best way to implement this?

A: 

In your server side project, you should have (but is not necessary) a People.cs class that contains your metadata, such as attributes for validation.

Also in your server project, create a public partial class named People.shared.cs. In this class you can add your methods such as the GetMyString() method. The People.shared.cs class gets code-generated (copied) to the client project.

krolley