我有一个数据库,我试图将dapper与Core Identity结合使用以对数据库进行查询。但我被困在这一点上。我正在从identityUser的界面使用User:
public class User : IdentityUser
{
}
使用dapper为CRUD制作自定义用户存储。
public class UserStore : IUserStore<User>
{
private readonly string connectionString;
public UserStore(IConfiguration configuration)
{
connectionString = configuration.GetValue<string>("DBInfo:ConnectionString");
}
internal IDbConnection Connection
{
get
{
return new SqlConnection(connectionString);
}
}
public Task<IdentityResult> CreateAsync(User user, CancellationToken cancellationToken)
{
**// HOW TO I RETURN A USER WITH DAPPER HERE?**
}
public Task<IdentityResult> DeleteAsync(User user, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
public Task<User> FindByIdAsync(string userId, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<User> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<string> GetUserIdAsync(User user, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<string> GetUserNameAsync(User user, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<IdentityResult> UpdateAsync(User user, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
谢谢!
请看一下我最近在GitHub上上传的一个项目-https: //github.com/giorgos07/Daarto正是您所需要的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句