1

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?

2 Answers 2

2

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;
Sign up to request clarification or add additional context in comments.

Comments

0

is User class have DataContract attribute?

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.