"n.uerkmez" की गतिविधियाँ

उत्तर

Hi there,

Thank you for your Master-Detail solution in ABP suite version 8.0.0.rc2. I have some suggestions for further improvement of this issue.

  1. Search is already available in the Master section. It would be great if we could also search in the Detail section. 2.Such a use case exists in business applications. An Entity with Entity type Child can be a Master for another page. For example, on a page (Authors) the Author entity can be the Master and the Book entity can be its child.
    But on the Books page, Book can be the Master, whereas Authors can be its child. What solution can you offer in this case?
उत्तर

Hi there,

The problem in the link is still present on the newly generated pages. It is not practical to offer a manual solution. Wouldn't it be better if you fixed the problem?

Thank you

Navigation properties do not work in generated UI (Angular)

https://support.abp.io/QA/Questions/5977/Navigation-properties-do-not-work-in-generated-UI-Angular#answer-3a0e4b05-6a9d-5a2a-323c-6dec5aef111f

Thanks

*This is a bug report only for ABP suite v. 7.4.0. It did not happen in the previous version. Please refund my ticket.

  • ABP Framework version: v7.4.4
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

*This is a bug report only for ABP suite v. 7.4.0. Please refund my ticket.

On any crud page, you create with Abp suite navigation fields (comboxes) are empty.

Thanks for the prompt answer.

I would like to create a global filter instead of aligning each Domain Service class like as following.

namespace MultiTenancyDemo.Products
{
    public class ProductManager : DomainService
    {
        private readonly IRepository<Product, Guid> _productRepository;

        public ProductManager(IRepository<Product, Guid> productRepository)
        {
            _productRepository = productRepository;
        }

        public async Task<long> GetProductCountAsync(Guid? tenantId)
        {
            using (CurrentTenant.Change(tenantId))
            {
                return await _productRepository.GetCountAsync();
            }
        }
    }
}

My question is about how to implement globally

Do you think the following code may work?

protected override Expression> CreateFilterExpression()
{
var parentTenantId = currentTenant.Id.ToString();
Guid[] tenantIdsToFilter;
using(currentTenant.Change(null))
{
    var tenants = await tenantRepository.GetListAsync();
    var subTenants = tenants.where(x => x.GetProperty<string>("ParentTenantId") == parentTenantId).ToList();
    tenantIdsToFilter = subTenants.Select(t=>t.Id).ToArray(); 
}

Expression<Func<TEntity, bool>> tenantIdFilterExpression =
    e => !IsActiveFilterEnabled || tenantIdsToFilter.Contains(EF.Property<Guid>(e, "TenantId"));
.......
}

I have checked this documentation. However, I need help to implement the following use case. https://docs.abp.io/en/abp/latest/Data-Filtering?&_ga=2.210300374.2127151687.1690988301-1686284556.1681286165#entityframework-core

Could you provide a sample on how to implement complex use-case (not only filter with a boolean value)?

In my use case, I need to find all sub Tenants by ParentTenantId and then filter the data accordingly.

List<Guid> subTenants = new List<Guid>(){ SubTenantsGuids};

I need to use create an expression like tenantId=> subTenants.contains(tenantId)

protected override Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>()
{
    var expression = base.CreateFilterExpression<TEntity>();

    if (typeof(IMultiTenant).IsAssignableFrom(typeof(TEntity)))
    {
        Expression<Func<TEntity, bool>> isTenantFilter =
          e => !IsTenantFilterEnabled || EF.Property<Guid>(e, "TenantId");
        expression = expression == null 
            ? isTenantFilter 
            : CombineExpressions(expression, isTenantFilter);
    }

    return expression;
}

How I can filter by a list of Guid in the section of Expression<Func<TEntity, bool>> isTenantFilter = e => !IsTenantFilterEnabled || EF.Property<Guid>(e, "TenantId"); expression = expression == null ? isTenantFilter : CombineExpressions(expression, isTenantFilter);**

Thanks in Advance

Thanks. That is good insight

  • ABP Framework version: v7.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
    • Exception message and full stack trace:
  • Steps to reproduce the issue:

ABP multitenancy;

  1. Can a tenant have multiple tenants in ABP Commercial? If not, what solution is the best practice for this use case? For example, Tenant-1 has 2 sub tenants. -Host -- Tenant-1 -------- Sub Tenant-01 --------Sub Tenant-02

  2. How can I override the routing path for Auto API Controllers? I mean that all API endpoint in the swagger must be generated with tenant-id by default as follows;

GetAsync(Guid id) GET /api/app/{tenant-id}/book/{id} GetListAsync() GET /api/app/{tenant-id}/book CreateAsync(CreateBookDto input) POST /api/app/{tenant-id}/book UpdateAsync(Guid id, UpdateBookDto input) PUT /api/app/{tenant-id}/book/{id} DeleteAsync(Guid id) DELETE /api/app/{tenant-id}/book/{id} GetEditorsAsync(Guid id) GET /api/app/{tenant-id}/book/{id}/editors CreateEditorAsync(Guid id, BookEditorCreateDto input) POST /api/app/{tenant-id}/book/{id}/editor

Thanks, that works.

67 प्रविष्टियों में 41 से 50 दिखा रहा है
Made with ❤️ on ABP v8.2.0-preview Updated on मार्च 25, 2024, 15:11