Base solution for your next web application

Activities of "m.aliozkaya"

Hi @mmukkara,

Could you share your AppPreBoostsrap file? Also, can you go to the /health URL?

Hi @JapNolt,

We found the problem. You can override feature value stores like this.

Go to the IdentityRegistrar class. Add .AddFeatureValueStore<FeatureValueStore>().

Remove Configuration.ReplaceService<IAbpZeroFeatureValueStore, FeatureValueStore>(); from Core Module

Hi @[email protected],

Based on your setup, it's possible to reuse the same authentication mechanism across both Web.Hostand Web.Reports without much customization. Since the TokenAuthController is already in the Web.Core project, both APIs can leverage the same logic seamlessly.

To achieve this, I recommend the following steps:

  • Move the AuthConfigurer class from Web.Host toWeb.Core. This will allow both Web.Host and Web.Reports to share the same authentication configuration without duplicating code.
  • In the Startup.cs of your Web.Reports project, ensure that the authentication settings mirror those of Web.Host. Specifically, copy over the configurations related to JWT authentication, authorization policies, and any other relevant middleware.

Once this setup is complete, the same token should work seamlessly across both APIs, allowing your frontend to authenticate once and access endpoints from both projects without issues.

Hi @[email protected],

I will review the code a bit more to provide the best solution.

Hi @JapNolt,

Thanks we will check it as soon as possible.

Hi @ips-ad,

Thanks for your feedback. I created an issue about it, the problem related to migrating to the file-scoped namespace https://github.com/aspnetzero/aspnet-zero-core/issues/5511

Hi @JapNolt,

I tested it as seen in the code examples below. I can override GetValueOrNull in both methods. If you share a sample project with me I can check it. [email protected]

IAbpZeroFeatureValueStore _featureValueStore;

public EditionAppService(
    IAbpZeroFeatureValueStore featureValueStore)
{
    _featureValueStore = featureValueStore;
}

private Task SetFeatureValues(Edition edition, List<NameValueDto> featureValues)
{
    _featureValueStore.GetValueOrNull(1, "TestEditionScopeFeature");
    _featureValueStore.GetValueOrNull(1, new Feature("TestEditionScopeFeature", "TestEditionScopeFeature"));
    
    return _editionManager.SetFeatureValuesAsync(edition.Id,
        featureValues.Select(fv => new NameValue(fv.Name, fv.Value)).ToArray());
}
using System.Threading.Tasks;
using Abp.Application.Features;
using Abp.Domain.Repositories;
using Abp.Domain.Uow;
using Abp.MultiTenancy;
using Abp.Runtime.Caching;
using PowerToolsTest12277Demo.Authorization.Users;
using PowerToolsTest12277Demo.MultiTenancy;

namespace PowerToolsTest12277Demo.Editions;

public class FeatureValueStore : AbpFeatureValueStore<Tenant, User>
{
    public FeatureValueStore(
        ICacheManager cacheManager,
        IRepository<TenantFeatureSetting, long> tenantFeatureSettingRepository,
        IRepository<Tenant> tenantRepository,
        IRepository<EditionFeatureSetting, long> editionFeatureSettingRepository,
        IFeatureManager featureManager,
        IUnitOfWorkManager unitOfWorkManager)
        : base(cacheManager,
            tenantFeatureSettingRepository,
            tenantRepository,
            editionFeatureSettingRepository,
            featureManager,
            unitOfWorkManager)
    {
    }

    public override string GetValueOrNull(int tenantId, Feature feature)
    {
        var x = 3;
        return base.GetValueOrNull(tenantId, feature);
    }
    
    public override string GetValueOrNull(int tenantId, string feature)
    {
        var x = 3;
        return base.GetValueOrNull(tenantId, feature);
    }

    public override void SetEditionFeatureValue(int editionId, string featureName, string value)
    {
        var y = 3;
        base.SetEditionFeatureValue(editionId, featureName, value);
    }

    public override Task SetEditionFeatureValueAsync(int editionId, string featureName, string value)
    {
        var z = 3;
        return base.SetEditionFeatureValueAsync(editionId, featureName, value);
    }
}

Configuration.ReplaceService<IAbpZeroFeatureValueStore, FeatureValueStore>();

Hi @mmukkara,

Could you check this documents? https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#determining-current-tenant https://docs.aspnetzero.com/aspnet-core-angular/latest/Infrastructure-Angular-Tenancy-Resolvers

Answer

Hi @Jorahealth,

For the database error, please look following links. But TrustServerCertificate=True; on Host project's appSettings should resolve this.

https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/error-message-when-you-connect https://umbracare.net/blog/how-to-fix-ssl-certificate-trust-issues-when-connecting-to-sql-server/

Run the yarn create-dynamic-bundles command at angular folder's path.

Answer

Hi @Jorahealth,

Add TrustServerCertificate=True; to your connection string.

Server=localhost; Database=TestDemoDb; Trusted_Connection=True; TrustServerCertificate=True;

Updating themes works the same way. https://docs.aspnetzero.com/common/latest/Version-Updating

  • Run yarn create-dynamic-bundles
Showing 1 to 10 of 390 entries