tags:

views:

21

answers:

2

Ok, i have the following object I pass back when someone calls "Authenticate" on my WCF Service (using http).

[DataContract]
public sealed class SecurityContext
{
    private Guid _tolken;
    private User _user;
    private ICallbackContract _callbackContract;

    [IgnoreDataMember]
    public ICallbackContract CallbackContract
    {
        get { return _callbackContract; }
    }

    [DataMember]
    public User User
    {
        get { return _user; }
        set { _user = value; }
    }

    [DataMember]
    public Guid Tolken
    {
        get { return _tolken; }
        set { _tolken = value; }
    }

    public SecurityContext(Guid tolken, User user, ICallbackContract callbackContract)
    {
        Asserter.IsNotNullArgument(tolken, "tolken");
        Asserter.IsNotNullArgument(user, "user");
        Asserter.IsNotNullArgument(callbackContract, "callbackContract");

        _tolken = tolken;
        _user = user;
        _callbackContract = callbackContract;
    }
}

For some reason, when i make the Async call, it times out and I never get a response, but when i comment out the User object (which is a Entity Framework object) it works fine.

Anyone ever experience this before?

A: 

is User class have DataContract attribute?

netmajor
Ya it is a Entity Object so it id defined like this [Serializable()][DataContractAttribute(IsReference=true)]public partial class User : EntityObject
Jeff
+1  A: 

Ok, so i figured out what the problem was. Apparently the entity model is set to Lazy load by default. This was causing issues with the data being HUGE when it was sent to the client...

I solved the issue by doing this during the entity model creation...

_entities.ContextOptions.LazyLoadingEnabled = false;
Jeff