public virtual SeverityVote AddSeverityVote(User user, int severity) { var severityVote = new SeverityVote(user, severity); ((IList<SeverityVote>) SeverityVotes).Add(severityVote); return severityVote; }
public static UserSession New(User user, DateTime? expires = null) { return new UserSession { Id = Guid.NewGuid(), User = user, Expires = expires ?? DateTime.Now.AddDays(10) }; }
public static void WithUser(this ConfigurableBootstrapper.ConfigurableBootstrapperConfigurator config, User user) { var nancyContext = new NancyContext { CurrentUser = new FireTowerUserIdentity(user) }; var contextFactory = new TestingContextFactory(nancyContext); config.ContextFactory(contextFactory); }
public UserSession Create(User user) { var userSession = new UserSession { Id = _tokenGenerator.Generate(), User = user, Expires = _tokenExpirationProvider.GetExpiration(_timeProvider.Now()) }; _writeableRepository.Create(userSession); return userSession; }
public void Seed() { var location = new Location {LocationId = 106781442691621, LocationName = "San Pedro Sula, Cortes"}; _session.Save(new User { FirstName = "Byron", LastName = "Sommardahl", Name = "Byron Sommardahl", FacebookId = 1817134138, Locale = "es_ES", Username = "******", Verified = true, Location = location }); var user = new User { FirstName = "Test", LastName = "Test", Name = "Test Test", Email = "*****@*****.**", EncryptedPassword = new HashPasswordEncryptor().Encrypt("password").Password, FacebookId = 1937134326, Locale = "es_ES", Username = "******", Verified = true, Location = location }; _session.Save(user); _session.Save(new UserSession { Expires = DateTime.Now.AddYears(1), User = user, Id = Guid.NewGuid() }); }
public SeverityVote(User user, int severity) { User = user; Severity = severity; }
public PutOutVote(User user, bool isPutOut) { User = user; IsPutOut = isPutOut; }
public ControlledVote(User user, bool isControlled) { User = user; IsControlled = isControlled; }
public virtual void addPutOutVote(User user, Guid disasterId, bool isPutOut) { var putOutVote = new PutOutVote(user, isPutOut); ((IList<PutOutVote>) PutOutVotes).Add(putOutVote); }
public virtual void AddControlledVote(User user, Guid disasterId, bool isControlled) { var controlledVote = new ControlledVote(user, isControlled); ((IList<ControlledVote>) ControlledVotes).Add(controlledVote); }
public FireTowerUserIdentity(User user) { User = user; }