Problem with RIA Authentication

I created an authentication service in the RIA that inherits from DomainService and IAuthenticate.

The problem is as follows:

When LoginOperation fails (loginOperation.LoginSuccess is false) due to incorrect credentials, everything is OK and reported to the user.

However, when the login succeeds, I get a really strange exception:

{System.ServiceModel.DomainServices.Client.DomainOperationException: The load operation failed for the Login request. The value cannot be null.

Parameter name: validationErrors ---> System.ArgumentNullException: value cannot be null. Parameter name: validationErrors in System.ServiceModel.DomainServices.Client.QueryCompletedResult..ctor (IEnumerable 1 entities, IEnumerable1 includedEntities, Int32 totalCount, IEnumerable`1 validationErrors)


I really don't get it. What is IEnumerable validationErrors, where does it appear and why should it be! = Null? It started after I ported authentication services from Nhibernate to the Entity Framework. I even tried using this exception, and apparently I'm the only one who has this problem.

Any help would be greatly appreciated.

+3
source share
2 answers

, RIA linq . Getter IEnumerable Roles. ; , return (from a in User.UserRoles select a.Description).AsEnumerable();, .

0

, !!!

, , ToList() :

[DataMember]
public IEnumerable<string> Roles
{
    get
    {
        return ApplicationRoles.Select(r => r.Name).ToList();
    }
    set
    {
        // TODO
    }
}
0

Source: https://habr.com/ru/post/1749052/


All Articles