コード例 #1
0
ファイル: Disaster.cs プロジェクト: kmiloaguilar/FireTower
        public virtual SeverityVote AddSeverityVote(User user, int severity)
        {
            var severityVote = new SeverityVote(user, severity);
            ((IList<SeverityVote>) SeverityVotes).Add(severityVote);

            return severityVote;
        }
コード例 #2
0
ファイル: UserSession.cs プロジェクト: rsiwady29/FireTower
 public static UserSession New(User user, DateTime? expires = null)
 {
     return new UserSession
     {
         Id = Guid.NewGuid(),
         User = user,
         Expires = expires ?? DateTime.Now.AddDays(10)
     };
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        public UserSession Create(User user)
        {
            var userSession = new UserSession
                                  {
                                      Id = _tokenGenerator.Generate(),
                                      User = user,
                                      Expires = _tokenExpirationProvider.GetExpiration(_timeProvider.Now())
                                  };

            _writeableRepository.Create(userSession);

            return userSession;
        }
コード例 #5
0
ファイル: UserSeeder.cs プロジェクト: rsiwady29/FireTower
        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()
                });
        }
コード例 #6
0
ファイル: SeverityVote.cs プロジェクト: rsiwady29/FireTower
 public SeverityVote(User user, int severity)
 {
     User = user;
     Severity = severity;
 }
コード例 #7
0
ファイル: PutOutVote.cs プロジェクト: rsiwady29/FireTower
 public PutOutVote(User user, bool isPutOut)
 {
     User = user;
     IsPutOut = isPutOut;
 }
コード例 #8
0
ファイル: ControlledVote.cs プロジェクト: rsiwady29/FireTower
 public ControlledVote(User user, bool isControlled)
 {
     User = user;
     IsControlled = isControlled;
 }
コード例 #9
0
ファイル: Disaster.cs プロジェクト: rsiwady29/FireTower
 public virtual void addPutOutVote(User user, Guid disasterId, bool isPutOut)
 {
     var putOutVote = new PutOutVote(user, isPutOut);
     ((IList<PutOutVote>) PutOutVotes).Add(putOutVote);
 }
コード例 #10
0
ファイル: Disaster.cs プロジェクト: rsiwady29/FireTower
 public virtual void AddControlledVote(User user, Guid disasterId, bool isControlled)
 {
     var controlledVote = new ControlledVote(user, isControlled);
     ((IList<ControlledVote>) ControlledVotes).Add(controlledVote);
 }
コード例 #11
0
 public FireTowerUserIdentity(User user)
 {
     User = user;
 }