I got an SL4 / WCF RIA Services / EF 4 application. I'm having trouble joining my SL4 data reference.
In the server side service portion of the application, this is my method:
[query (IsDefault = true)] public IQueryable & lt; Tooling Group & gt; GetToolingGroups () {var group = this.ObjectContext.ToolingGroups.Include ("Metadata"). OrderBy (g = & gt; g.Name); Return group; // breakpoint set here} I have assigned it to different groups so that it can be verified before the method returns. If I set up a breakpoint before the law returns and add a line to my watch window then there is a metadata: when I return the method and see the metadata completed in silver illumination ui in metadata completed.
zero load operation_ful (object sender, System.EventArgs e) {grid.ItemsSource = _toolingContext.ToolingGroups; UpdateUI (); // breakpoint set here} When I do this in my watch window the metadata is zero:
_toolingContext.ToolingGroups.First (). Metadata I was checked to ensure that the Tolling Group was brought back by call. In both cases the first () was the same unit and it was.
Why has metadata lost (e.g., zero) between the service method and my UI method?
Solution:
// MetadataType properties tooling group recognizes metadata as class / which makes extra metadata for the tooling group class. [Metadata Type Specialty (Typing Group. Toeing Group Metatadata))] Public Partial Classroom Tolling Group {// From this class you can attach the custom properties of the properties of the tooling group class. // // For example, the following marks the Xyz property as a required asset and specifies the format for valid values: // [required] // [Regular expression ("[AZ] [AZ] -J 0-9] * ")] // [string string (32)] / public string Xyz {get; Set; } Internal sealed class toolinggram metadata {// Metadata classes are not for immediate occurrence. Private tooling group metadata () {} Public Ent ID {Received; Set; } [Include] // Added metadata to the public metadata metadata serial {get; Set; } Public taps qualified & lt; Int & gt; Metadetidae {receive; Set; } Public string name {get; Set; } Get the Public ToolingGrase Tooling Category {Get; Set; } Public int ToolingCategoryId {get; Set; } Public Entity Collection & lt; Tooling type & gt; Tooling Type {Receive; Set; There are two layers on the play here, EF and RIA Services you have EF The part is handled Now you need to tell the RIA services to include the property when it will serial your units on the wires. In your metadata for the unit, add [include] attribute. Metadata type (Typing Group). Metadata) Public partial classroom tooling group {Private class metadata {// Adding this feature RIA services also know that [/ s] public metadata metadata {get; Set;}}} It is a bad coincidence that your type is called "metadata", the tooling group. Metadata is class metadata which uses RIA services.
Comments
Post a Comment