Exemplo n.º 1
0
        public UserSessionGet(UserSessionGetRequest request)
        {
            if (request != null && request.SessionKey != null)
            {
                using (var dbContext = new ApplicationDbContext())
                {
                    var session = dbContext.UserSessions.SingleOrDefault(aUserSession => aUserSession.SessionKey == request.SessionKey);

                    if (session != null && session.User != null)
                    {
                        Response = new UserSessionGetResponse
                        {
                            SessionKey     = session.SessionKey,
                            UserIdentifier = session.User.Identifier,
                            UserEmail      = session.User.Email,
                            UserGroupType  = session.User.GroupType,
                        };
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Initialize(UserSessionGetResponse response)
 {
     SessionKey            = response.SessionKey;
     CurrentlyLoggedOnUser = new CurrentlyLoggedOnUser(response);
 }
Exemplo n.º 3
0
 public CurrentlyLoggedOnUser(UserSessionGetResponse response)
 {
     Email      = response.UserEmail;
     Identifier = response.UserIdentifier;
     GroupType  = response.UserGroupType;
 }