예제 #1
0
        public async Task <AppSession> Create(string sessionKey, IAppUser user, DateTimeOffset timeStarted, string requesterKey, string userAgent, string remoteAddress)
        {
            var record = new AppSessionRecord
            {
                SessionKey    = sessionKey,
                UserID        = user.ID.Value,
                TimeStarted   = timeStarted,
                RequesterKey  = requesterKey ?? "",
                TimeEnded     = DateTimeOffset.MaxValue,
                UserAgent     = userAgent ?? "",
                RemoteAddress = remoteAddress ?? ""
            };
            await factory.DB.Sessions.Create(record);

            return(factory.Session(record));
        }
예제 #2
0
 internal AppSession Session(AppSessionRecord record) =>
 new AppSession(this, record);
예제 #3
0
 internal AppSession(AppFactory factory, AppSessionRecord record)
 {
     this.factory = factory;
     this.record  = record ?? new AppSessionRecord();
     ID           = new EntityID(this.record.ID);
 }