Gon*_*alo 13 dapper asp.net-identity asp.net-core
我有一个数据库,我试图使用dapper与核心身份来查询数据库.但我在这一点上陷入困境.我从identityUser的界面使用用户:
public class User : IdentityUser
{
}
Run Code Online (Sandbox Code Playgroud)
使用精巧的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();
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
| 归档时间: |
|
| 查看次数: |
8764 次 |
| 最近记录: |