Activities of "liangshiwei"

See https://github.com/abpframework/abp/issues/1414#issuecomment-508818941.

If you still want add navigation properties, please do this:

Entity:

public class UnitCategory : Entity<Guid>
{
    public UnitCategory(Guid id)
    {
        Id = id;
    }

    public List<OrganizationUnit> OrganizationUnits { get; set; }
}

DbContext:

protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);

    /* Configure the shared tables (with included modules) here */

    builder.Entity<AppUser>(b =>
    {
        b.ToTable(AbpIdentityDbProperties.DbTablePrefix +
                  "Users"); //Sharing the same table "AbpUsers" with the IdentityUser

        b.ConfigureByConvention();
        b.ConfigureAbpUser();

        /* Configure mappings for your additional properties
         * Also see the qaEfCoreEntityExtensionMappings class
         */
    });

    // add this..
    builder.Entity<OrganizationUnit>(b =>
    {
        b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "OrganizationUnits");

        b.ConfigureByConvention();

        b.Property(ou => ou.Code).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxCodeLength)
            .HasColumnName(nameof(OrganizationUnit.Code));
        b.Property(ou => ou.DisplayName).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxDisplayNameLength)
            .HasColumnName(nameof(OrganizationUnit.DisplayName));

        b.HasMany<OrganizationUnit>().WithOne().HasForeignKey(ou => ou.ParentId);
        b.HasMany(ou => ou.Roles).WithOne().HasForeignKey(our => our.OrganizationUnitId).IsRequired();

        b.HasIndex(ou => ou.Code);
    });

    builder.Ignore<OrganizationUnitRole>();

    builder.Configureqa();
}

DbContextModelCreatingExtensions:

builder.Entity<UnitCategory>(b =>
{
    b.ToTable("UnitCategory");
    b.HasMany(x => x.OrganizationUnits).WithOne().HasForeignKey("UnitCategoryId");
    b.ConfigureByConvention();
});

EfCoreEntityExtensionMappings:

ObjectExtensionManager.Instance
    .MapEfCoreProperty<OrganizationUnit, Guid?>(
        "UnitCategoryId",
        b => b.HasMaxLength(64)
    );

Hi,

You can customize the page, see : https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-User-Interface.

If you are using MVC UI, you can use virtual file explorer to see dashboard page source code.

Volo.Abp.Http.Client.AbpRemoteCallException

I see you are using remote service, You need to disable the multi-tenant filter in the service implementation. like this:

public async Task<Unit> GetAsync(Guid id, bool ignoreTenant = false)
{
       if(ignoreTenant){
            using (_dataFilter.Disable<IMultiTenant>())
            {
                //query...
            }
       }
       else{
               // query...
       }
}

Hi,

There is an example to help you : https://github.com/abpframework/abp-samples/tree/master/DocumentationSamples/CustomApplicationModules.

Hi,

You can two options:

  1. Remove options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>..... code.
  2. Download the abp source code and put it in the same directory as abp-samples.

HI,

I will check it out.

Hi.

DataFilter only use shared database. If you use a tenant-separated database, DataFilter is not work.

Hi,

Because the data is isolated, The host cannot read the tenant's data. If you want read all tenant's data. you can get all tenants and loop get the data. like this:

var tenants = await _tenantRepository.GetListAsync();

foreach (var tenant in tenants)
{
    using (CurrentTenant.Change(tenant.Id))
    {
          var unit = await _unitAppService.GetAsync(Guid.Parse("ED9D4AC2-BC3F-1FA4-71D6-39F5F9048F20"));
    }
}

I can't reproduce your problem. Could your use CLI to create a free template to reproduce this problem? thanks.

Hi,

Can you provide steps and share some unit tests code? Thanks.

Showing 5411 to 5420 of 5643 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30