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.
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
[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; }
http://www.silverlightshow.net/items/Creating-applications-with-.NET-RIA-Service-Part-3-Adding-DomainService-class.aspx
http://blogs.msdn.com/brada/archive/2009/07/22/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-part-6-poco-and-authentication-provider.aspx
, , OtherObject. , .
OtherObject
[DataContract] public abstract class BarrieHibbertWrapper { [DataMember] public string Name { get; set; } }
System.RunTime.Serialization .
System.RunTime.Serialization
, , .
Source: https://habr.com/ru/post/1717240/More articles:Как проверить новые функции, не повреждая багажник? - version-controlPeriod-supported date and time library for C # / VB.NET? - c #Why jQuery.browser.version returns 1.9.1.2 for Firefox 3.5.2 - jqueryUsing AcceptChanges with SQL Server - c #Get CSS style from PHP - domStatic polymorphism in Delphi - delphiMerging resources Dictionaries dynamically at runtime (for plugins) - c #How to choose where to store an object in C ++? - javaMicrosoft Robotics Studio and absolute contour problems - robotics-studioПроблема с заголовком панели навигации - iphoneAll Articles