Pass a list of GrantedPermissions
to StaticRoleDefinition in MyProject.Authorization.Roles.AppConfig.Configure
.
<!-- -->
ConnectionString
in CreateTenantInput.I believe you're missing a DependsOn
:
[DependsOn(typeof(GeneralTreeModule))]
public class StatusCastCoreModule : AbpModule
Note that Abp.GeneralTree is not an official ABP package.
http://docs.aspnetzero.com/documents/zero/latest/Development-Guide-Rad-Tool#how-to-edit-pre-defined-templates-or-create-a-new-template
https://momentjs.com/docs/
Specify Id
instead of Dependent
in your DTO.
No. Feature request: https://github.com/aspnetzero/aspnet-zero-core/issues/752
- How to avoid getting BenefitEnrolmentRule in the DependentEnrolmentRule (as this is already a parent object, why do I need it again for child), why it is retrieved in child object too.
From https://docs.microsoft.com/en-us/ef/core/querying/related-data#eager-loading:
Entity Framework Core will automatically fix-up navigation properties to any other entities that were previously loaded into the context instance. So even if you don't explicitly include the data for a navigation property, the property may still be populated if some or all of the related entities were previously loaded.
Related: https://github.com/aspnet/EntityFrameworkCore/issues/11564
- How can I fix this issue without writing ForEach loop for DependentEnrolmentRule and update.
Try these:
i. Don't query BenefitEnrolmentRule
unnecessarily:
public async Task UpdateBenefitEnrolmentRule(BenefitEnrolmentRuleDto input)
{
var benefitEnrolmentRule = ObjectMapper.Map<BenefitEnrolmentRule>(input);
await _benefitEnrolmentRepository.UpdateAsync(benefitEnrolmentRule);
}
ii. Don't include DependentEnrolmentRules
unnecessarily:
public async Task UpdateBenefitEnrolmentRule(BenefitEnrolmentRuleDto input)
{
var benefitEnrolmentRule = await _benefitEnrolmentRepository.GetAll()
.Where(e => e.Id == input.Id)
.SingleOrDefaultAsync();
ObjectMapper.Map(input, benefitEnrolmentRule);
await _benefitEnrolmentRepository.UpdateAsync(benefitEnrolmentRule);
}
iii. Specify .AsNoTracking()
:
public async Task UpdateBenefitEnrolmentRule(BenefitEnrolmentRuleDto input)
{
var benefitEnrolmentRule = await _benefitEnrolmentRepository.GetAll()
.Include(e => e.DependentEnrolmentRules)
.Where(e => e.Id == input.Id)
.AsNoTracking()
.SingleOrDefaultAsync();
ObjectMapper.Map(input, benefitEnrolmentRule);
await _benefitEnrolmentRepository.UpdateAsync(benefitEnrolmentRule);
}
- Am I doing something wrong.
For starters:
TenantCacheExtensions
must not be generic if you expect ABP to register it by convention.var organizationUnitIdsOfUser = _userOrganizationUnitRepository.GetAll()
.Where(uou => uou.UserId == input.UserId)
.Select(uou => uou.OrganizationUnitId);