2015-08-05 19:28:16 +08:00
|
|
|
|
using NServiceKit.DataAnnotations;
|
|
|
|
|
using NServiceKit.DesignPatterns.Model;
|
2015-09-22 21:34:52 +08:00
|
|
|
|
using NServiceKit.Redis;
|
2015-08-05 19:28:16 +08:00
|
|
|
|
using System;
|
2015-09-22 21:34:52 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2015-08-05 19:28:16 +08:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace RedisMongoMigration.Redis
|
|
|
|
|
{
|
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
[DataObject]
|
|
|
|
|
public class RedisMember : IHasId<Guid>
|
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
[Index]
|
|
|
|
|
public Guid Id { get; set; }
|
2015-08-05 19:28:16 +08:00
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
[Key]
|
|
|
|
|
public string UserName { get; set; }
|
|
|
|
|
public byte[] PassHash { get; set; }
|
|
|
|
|
public byte[] PassSalt { get; set; }
|
2015-08-05 19:28:16 +08:00
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
[Key]
|
|
|
|
|
public string EmailAddress { get; set; }
|
2015-08-05 19:28:16 +08:00
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
public bool IsApproved { get; set; }
|
|
|
|
|
public bool IsLockedOut { get; set; }
|
2015-08-05 19:28:16 +08:00
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
public DateTime CreationDate { get; set; }
|
|
|
|
|
public DateTime LastActivityDate { get; set; }
|
|
|
|
|
public DateTime LastLockoutDate { get; set; }
|
|
|
|
|
public DateTime LastLoginDate { get; set; }
|
2015-08-05 19:28:16 +08:00
|
|
|
|
|
2015-09-22 21:34:52 +08:00
|
|
|
|
public DateTime LockoutWindowStart { get; set; }
|
|
|
|
|
public int LockoutWindowAttempts { get; set; }
|
|
|
|
|
|
|
|
|
|
public static IEnumerable<RedisMember> Select()
|
|
|
|
|
{
|
|
|
|
|
using (RedisClient rClient = new RedisClient("localhost", 6379, db: 1))
|
|
|
|
|
{
|
|
|
|
|
var client = rClient.As<RedisMember>();
|
|
|
|
|
return client.GetAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-05 19:28:16 +08:00
|
|
|
|
}
|