Ends in:
7 DAYS
13 HRS
32 MIN
29 SEC
Ends in:
7 D
13 H
32 M
29 S

Activities of "SuperBeastX3"

Same result, just returns the default value of the feature.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Security.Claims;
using Volo.Saas.Tenants;

namespace MyCore.DataSeedContributors
{
    public class AddAbpRoleDataSeedContributor : IDataSeedContributor, ITransientDependency
    {
        private readonly IdentityUserManager _identityUserManager;
        private readonly IdentityRoleManager _identityRoleManager;
        private readonly IPermissionDataSeeder _permissionDataSeeder;
        private readonly IFeatureChecker _featureChecker;
        private readonly IPermissionDefinitionManager _permissionDefinitionManager;


        public AddAbpRoleDataSeedContributor(IdentityUserManager identityUserManager, IdentityRoleManager identityRoleManager, IPermissionDataSeeder permissionDataSeeder, IFeatureChecker featureChecker, IPermissionDefinitionManager permissionDefinitionManager)
        {
            _identityUserManager = identityUserManager;
            _identityRoleManager = identityRoleManager;
            _permissionDataSeeder = permissionDataSeeder;
            _featureChecker = featureChecker;
            _permissionDefinitionManager = permissionDefinitionManager;
        }

        public async Task SeedAsync(DataSeedContext context)
        {
            var version = await _featureChecker.GetOrNullAsync("Version");
            
            if(version == "V2") 
            {
                //dosomething for V2 

            }
            else
            {
                //dosomthing for V1
            }
        }
    }
}

In addition to this, I really want to know what Edition the tenant I just created is using, but I can't seem to find a way to it.

Im not sure I understand what you are asking. The tenant id that gets passed into the data seeding is the correct Id, and all the seeded items have the correct tenant id. I do not use currenttenant in the data seeding.

Can you be more specific as to what you are asking?

First, I created a new feature using this:

var myGroup = context.AddGroup("Version");


myGroup.AddFeature(
    "Version",
    defaultValue: "V1",
    displayName: LocalizableString
    .Create<MaestroCoreResource>("My.Version"),
    valueType: new SelectionStringValueType
    {
        ItemSource = new StaticSelectionStringValueItemSource(
           new LocalizableSelectionStringValueItem
           {
               Value = "V1",
               DisplayText = new LocalizableStringInfo("MyResource", "My.Version.V1")
           },
           new LocalizableSelectionStringValueItem
           {
               Value = "V2",
               DisplayText = new LocalizableStringInfo("MyResource", "My.Version.V2")
           }),
        Validator = new AlwaysValidValueValidator()
    }
);

Then, when I create a Tenant, I am choosing "V2" for my Version feature.

When it seeds the data, I want to do specific seeding based on that version:

var version = await _featureChecker.GetOrNullAsync("Version");

if(version == "V2") 
{
    //do something for V2

}
else
{
    //do something for V1
}

I would expect the code of: await _featureChecker.GetOrNullAsync("Version"); Would return the correct version, but no matter what it always returns the default value set in the feature.

It turns out it was just a fault combination of the abp suite generator. I did not successfully choose all the right options on the create new project screen.

mahmut, Thanks for that. I didn't know I could edit the templates. However, that doesn't really answer my question though. I want to make sure Im fitting the designs of ABP for my parent/child or many to many records. Is there a sample I can work from?

I'll give that a try. Its not critical, as we are not using the private repo yet. I will further troubleshoot if needed.

I'm not emailing credentials over, that goes against policy.

I'll try to conform that guid as the other developer generated it. Commercial account is under Primary Cyber LLC

The guid came from the abp platform for our primary users account.

I'll try to conform that guid as the other developer generated it. Commercial account is under Primary Cyber LLC

Showing 11 to 20 of 21 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06