예제 #1
0
 private static MongoUserSession MapToMongoUserSession(Domain.Model.UserSession userSession)
 {
     return(new MongoUserSession
     {
         Id = userSession.Id,
         UserId = userSession.UserId,
         State = userSession.State
     });
 }
예제 #2
0
        public void Update(Domain.Model.UserSession userSession)
        {
            if (userSession == null)
            {
                throw new ArgumentNullException(nameof(userSession));
            }

            var mongoUserSession = MapToMongoUserSession(userSession);

            _repository.ReplaceOne(s => s.Id == mongoUserSession.Id, mongoUserSession);
        }
예제 #3
0
        public void Insert(Domain.Model.UserSession userSession)
        {
            if (userSession == null)
            {
                throw new ArgumentNullException(nameof(userSession));
            }

            var mongoUserSession = MapToMongoUserSession(userSession);

            _repository.Insert(mongoUserSession);
        }