Robert, thanks, but that's all I tried and it doesn't stop it from being called :(
DaBudhaMan...this is exactly what I need...thanks sooo much! Interestly I've digged through the code today and found the value provider, however my mind just didn't see that as an option...I've just looked in other places to add that same logic...thanks so much for the heads up! Ill post the code when I am done! :) Vladan On 2 velj, 15:40, DaBuddhaMan <[email protected]> wrote: > You can create your own ContractResolver. > In there you create your own IValueProvider by overriding the > CreateMemberValueProvider method. > In your own IValueProvider you override the GetValue method where you > check if the proxy was initialized or not. > > On 2 feb, 12:16, Vladan Strigo <[email protected]> wrote: > > > I have a small problem while serializing an Entity to Json. > > > Lets say that we have a model: Customer <-> Product, so Customer has > > Product propery, Product has Customers collection property....it comes > > down to Customer.Product.Customers. > > > I eagerly load Customer and his Product, but when sending it to > > Serializer (Json.Net), it accesses Customers property of Product, and > > thus triggers the lazy load to db. > > > Is there a way to stop lazy load from occuring...and in this case I > > don't want to: > > > a) not map this side of relationship > > b) make another model like a viewmodel which is simpler > > c) not eagerly fetch the Customers property because in fact I don't > > need it. > > > Is there a way to stop lazy load while querying?! > > > Thanks! > > Vladan > > > @Fabio: this is the last part to make serialization work as expected, > > when it does Ill post up the code to serialize Entity to Json using > > Json.Net :) -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
