Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 03, 2012 09:14 AM by r.rajeshkhunt
May 03, 2012 08:53 AM|LINK
I am using ASP.NET 4.0. I've created a web service that inserts a book. The WebMethod is taking book Entity (the entity generated from EntityFramwork Model) and then insert. my problem is in the application where i referenced this webservice in. in The Reference.cs
class the partial class for the book has only the main feilds of the book ENtity ( no related Entities contained in the book object). my question is how can i include the related entities?
May 03, 2012 09:14 AM|LINK
You are going to have a difficult time getting this to work the way you have it designed. Remember that once the entity gets serialized and sent across the wire, you lose all information that was associated with the
Also, unless you specifically included a reference to the assembly with the Entity Framework Models and chose to reuse those types, then the types you are dealing with are only representative clones of the actual Models in your
The navigation properties only make sense when the entity is attached to a DataContext, since that is what handles all the magic of calling the database and hydrating the entity being requested. You are essentially getting a POCO from
your web service, but you are trying to use it as though it were still attached to its context.