Hi @XugoWebTeam,
Could you check this article? I think this attribute can solve your problem https://aspnetboilerplate.com/Pages/Documents/Unit-Of-Work#unitofwork-attribute
Hi @XugoWebTeam,
The following snippet may help solve your problem. If the problem persists, let us know.
public class UserManagerTests : AppTestBase
{
private readonly IUserRepository _userRepository;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public UserManagerTests()
{
_userRepository = Resolve<IUserRepository>();
_unitOfWorkManager = Resolve<IUnitOfWorkManager>();
}
[Fact]
public async Task Should_Get_Active_Users()
{
// Arrange
var users = await _userRepository.InsertAsync(new User()
{
UserName = "test", IsActive = true, TenantId = 1, Name = "john", Surname = "smith",
EmailAddress = "[email protected]", Password = "test", NormalizedUserName = "john",
NormalizedEmailAddress = "[email protected]"
});
using var uow = _unitOfWorkManager.Begin();
var activeUsers = await _userRepository.GetAll()
.Where(u => u.IsActive)
.Select(u => u.Id)
.ToListAsync();
activeUsers.ShouldNotBeNull();
// var activeUsers = _userRepository.GetAll()
// .Where(u => u.IsActive)
// .Select(u => u.Id)
// .ToListAsync();
//
// await activeUsers.ShouldNotBeNull();
}
}
Hi @XugoWebTeam,
I think this problem is related to the unit of work. You can use the following code for testing
await UsingDbContextAsync(async context =>
{
var activeUsers = await context.Users
.Where(u => u.IsActive)
.Select(u => u.Id)
.ToListAsync();
activeUsers.ShouldNotBeNull();
});
Hi @murphymj5209,
For now, you can review this solution; it will be fixed in version 12.2.1.
https://support.aspnetzero.com/QA/Questions/11610/power-tool-is-not-generating-properly#answer-3ad0f9b2-22de-c8a1-5af0-3a0ba17e95ba
Hi @MYBUSINESSDNA,
You're absolutely correct! We've made a significant improvement by moving the AppPermissions
class to */Core.Shared
. This change allows us to utilize it in our mobile apps (MAUI) without having to duplicate any code.
Hi @muhittincelik,
I created an issue about it. You can follow the process here https://github.com/aspnetzero/aspnet-zero-core/issues/4881
Hi @mittera,
I tried this in many different forms.
Workflow, Workflow Symbol, ProductionOutput, WorkflowProperty, WorkflowSymbolProperty then Workflow Symbol, ProductionOutput, Workflow, WorkflowSchedule, Workflow and etc
But I can't reproduced it. It may happen in a very exceptional situation. If you still have the problem, could you share this project with us [email protected]
Hi @mittera,
Thanks for your idea. We don't have any plans for this at the moment. We may consider making such an improvement in the future.
Hi @mittera ,
I tried to reproduce it but it seems working. I created 3 entities and A master B Child (B master C child). When I regenerate it is working. Is your power tools updated?
Hi @mittera,
Could you share .json files with us?