Last active
October 25, 2017 01:19
-
-
Save mythz/2335f9629cf0937c6f1885627875cf07 to your computer and use it in GitHub Desktop.
Test RedisAuthRepository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using ServiceStack; | |
using ServiceStack.Auth; | |
using ServiceStack.Text; | |
using ServiceStack.Redis; | |
using ServiceStack.Testing; | |
using ServiceStack.DataAnnotations; | |
IUserAuth fromRedis; | |
var redisManager = new RedisManagerPool("localhost:6379"); | |
using (new BasicAppHost().Init()) | |
using (var redis = redisManager.GetClient()) | |
{ | |
var redisAuth = new RedisAuthRepository(redisManager); | |
var id = new Random().Next(1,10000); | |
var userAuth = redisAuth.CreateUserAuth(new UserAuth | |
{ | |
UserName = $"UserName{id}", | |
Email = $"test@email{id}.com", | |
DisplayName = "First Last", | |
}, "test"); | |
fromRedis = redis.As<IUserAuth>().GetById(userAuth.Id); | |
fromRedis.PrintDump(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="ServiceStack.Text" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack.Client" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack.Interfaces" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack.Redis" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack.Common" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack" version="4.5.14" targetFramework="net45" /> | |
<package id="ServiceStack.Server" version="4.5.14" targetFramework="net45" /> | |
</packages> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment