Submitting Object Content Through RIA Services

I have a class as follows:

public class object {
   [Key]
   int number;

   String mystring;

   OtherObject anotherobject;
}

When I sent this via RIA, the silverlight application can see object.number and object.mystring, but not object.anotherobject !!! What should I do?? Please help me.

+3
source share
3 answers

You need to do [Include] and [Association] on the object, and the association parameters must be other objects [Key]

You can also send from server to client, but not CLient to the server, namely, how RIA works, because it sucks

0
source

[Include] , , , :

public class Monkey 
{
   [Key]   
   int number;
   String mystring;

   [Include]
   OtherObject anotherobject;
}

:

public IQueryable<Monkey> GetMonkeys()
{            
   var Monkey = this.Context.Monkey.Include("Monkey.OtherObject");
   return Monkey;
} 

:

+1

, , OtherObject. , .

:

[DataContract]
public abstract class BarrieHibbertWrapper
{
   [DataMember]
   public string Name { get; set; }
}

System.RunTime.Serialization .

, , .

-1

Source: https://habr.com/ru/post/1717240/


All Articles