Is there a way where I find one item of this list and want to update its "PropertyAdded" column. How do I do this ?
I think the document it clear, you can check it: https://docs.abp.io/en/abp/latest/Object-Extensions#setproperty
Is there any abp.io document where implementation of UserValidator class is provided ? Can you provide me sample of this class ? And how can I find my custom column here ?
Example:
public class MyUserValidator<TUser> : IUserValidator<TUser> where TUser : Volo.Abp.Identity.IdentityUser
{
private readonly IIdentityUserRepository _userRepository;
public MyUserValidator(IIdentityUserRepository userRepository)
{
_userRepository = userRepository;
}
public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user)
{
//....
}
}
PreConfigure<IdentityBuilder>(builder =>
{
builder.AddUserValidator<MyUserValidator<Volo.Abp.Identity.IdentityUser>>();
});
In the below code there is one option called options.SignIn.RequireConfirmedEmail If I would able to find my added column here I think it will resolve my issue.
No you can't
Hi,
It works for me.
public class IndexModel : AbpPageModel
{
public void OnGet()
{
throw new Exception("test");
}
}
app.UseExceptionHandler(x => x.Run(async errorContext =>
{
errorContext.Response.StatusCode = (int) HttpStatusCode.InternalServerError;
errorContext.Response.ContentType = "text/html";
await errorContext.Response.WriteAsync("<html lang=\"en\"><body>\r\n");
await errorContext.Response.WriteAsync("ERROR!<br><br>\r\n");
var exceptionHandlerPathFeature =
errorContext.Features.Get<IExceptionHandlerPathFeature>();
if (exceptionHandlerPathFeature?.Error is FileNotFoundException)
{
await errorContext.Response.WriteAsync(
"File error thrown!<br><br>\r\n");
}
await errorContext.Response.WriteAsync(
"<a href=\"/\">Home</a><br>\r\n");
await errorContext.Response.WriteAsync("</body></html>\r\n");
await errorContext.Response.WriteAsync(new string(' ', 512));
}));
Could you share a project to reproduce it? shiwei.liang@volosoft.com
Hi,
When we add the module Lepton.Themes,
Lepton theme is pre-installed, but I will try reproduce it. it will be helpful if you can provide steps to reproduce. thanks.
Hi
And while fetching roles via. RoleRepository.GetListAsync() suppose I want roles only specific for CatA.
Yes you can do this, there are two ways:
var users = (await _userRepository.GetListAsync()).Where(x => x.GetProperty<int>("PropertyAdded") == 1).ToList();
see : https://docs.abp.io/en/abp/latest/Entity-Framework-Core#access-to-the-ef-core-api
var users = (await _userRepository.GetDbSetAsync()).Where(x => EF.Property<int>(x, "PropertyAdded") == 1).ToListAsync();
How can I achieve this and where to do respective changes.
You can use the IUserValidator
See https://github.com/abpframework/abp/issues/3990
hi,
I think you need re create the database.
HI,
You can implement it in the entityframeworkcore project
public class MyUserRepository : EfCoreRepository<IIdentityDbContext, IdentityUser, Guid> , IMyUserRepository
{
public MyUserRepository(IDbContextProvider<IIdentityDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public async Task<List<IdentityUser>> GetListAsync(.....)
{
return await (await GetDbSetAsync()).Where(x => EF.Property<int>(x, "PropertyAdded") == 1).ToListAsync();
}
}
Hi,
I can't reproduce this problem, could you share a project to reproduce? thanks. shiwei.liang@volosoft.com
Hi,
I think you need : https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.ef.property?view=efcore-5.0#examples