Hi,
I think the functions FindAsync/CreateAsync in RavenUserStore are not stable. In my previous projects, I had a lot of troubles with stale data, even with static indexes. IMHO, a Raven "style" will be better. Let's treat RavenUserLogin as independent document
public class RavenUserLogin
{
const string KEY_TEMPLATE = "RavenUserLogin/{0}/{1}";
public RavenUserLogin()
{
}
public RavenUserLogin(UserLoginInfo loginInfo, string userId)
{
Id = GenerateKey(loginInfo);
UserId = userId;
}
public string Id { get; set; }
public string UserId { get; set; }
public static string GenerateKey(UserLoginInfo loginInfo)
{
return string.Format(KEY_TEMPLATE, loginInfo.LoginProvider, loginInfo.ProviderKey);
}
}
Then,
public async Task<TUser> FindAsync(UserLoginInfo login)
{
var lg = await DocumentSession
.Include<RavenUserLogin>(x=>x.UserId)
.LoadAsync<RavenUserLogin>(RavenUserLogin.GenerateKey(login));
return (lg != null) ? await DocumentSession.LoadAsync<TUser>(lg.UserId) : null;
}
Hi, I think the functions FindAsync/CreateAsync in RavenUserStore are not stable. In my previous projects, I had a lot of troubles with stale data, even with static indexes. IMHO, a Raven "style" will be better. Let's treat RavenUserLogin as independent document
Then,
Best, T.C