locked
Domain Service Class Update has no Effect on Silverlight Side RRS feed

  • Question

  • Hello,

    I have SL 4 + RIA Services application containing a DomainServiceClass that expose my Entities (Entity Framework).

    Recentely I performed an update on the model (I added a new entity called "Projects" and added a relation between this entity and an existing one already in model). Everyting was changed in database then I just update the .EDM diagram.

    I no there are many issues regarding DomainServiceClass update and I opted to perform updates manually, since it was just a few things. Basically I added the new methods on the domain service class and updated the metadata file.

    Everything is compiling fine, but I have a problem with a master/details feature in the silverlight app.

    The new entity "Project" is the master, so I change its Get method to include my details:

    public IQueryable<Project> GetProjects()
            {
                return this.ObjectContext.Projects.Include("PieceGroups");
            }

     I also added a Include atribute on the metadata class to include the details:

       [Include]
                public EntityCollection<PieceGroup> PieceGroups { get; set; }
    

     I have check that when GetProjects is invoked, the details entities are retrieved sucessfully. However, they are not available on the silverlight client application.

     

    Is there anything I must manually update on the silverlight application to make it work?

    Thank you,

     

    Igor.

     

    Wednesday, March 21, 2012 10:32 AM

Answers

  • As long as PieceGroups has its primary and foreign key setup correctly that should work. What have you done client side to see if the entities are there or not? Have you tried checking the EntitySet to see if it has anything? Since you don't have an explicit get, the EntitySet will be available as <DomainContext>.EntityContainer.GetEntitySet<PieceGroup>.

    Also, if this is a Many-to-Many relationship you need to expose the linking table.

    Wednesday, March 21, 2012 5:24 PM

All replies

  • As long as PieceGroups has its primary and foreign key setup correctly that should work. What have you done client side to see if the entities are there or not? Have you tried checking the EntitySet to see if it has anything? Since you don't have an explicit get, the EntitySet will be available as <DomainContext>.EntityContainer.GetEntitySet<PieceGroup>.

    Also, if this is a Many-to-Many relationship you need to expose the linking table.

    Wednesday, March 21, 2012 5:24 PM
  • Hello ColinBlair,

    I can instantiate an objecto of type "Project" in the silverlight app. I am working in a master/details scenario on it and the details datagrid, that contains my "PieceGroup" list for the selected "Project" automatically generates the entity columns correctly. So we can say the client application knows what a PieceGroup or Project is.

     

    Wednesday, March 21, 2012 9:26 PM