private static MongoUserSession MapToMongoUserSession(Domain.Model.UserSession userSession) { return(new MongoUserSession { Id = userSession.Id, UserId = userSession.UserId, State = userSession.State }); }
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); }
public void Insert(Domain.Model.UserSession userSession) { if (userSession == null) { throw new ArgumentNullException(nameof(userSession)); } var mongoUserSession = MapToMongoUserSession(userSession); _repository.Insert(mongoUserSession); }