Base solution for your next web application

Activities of "asrar"

Hi,

In a multi-tenancy setup with separate database for each tenant, how do we enable code-first migration for all tenant databases in the event we change the code? Currently i run the update-database on master but when i log into tenants, i will get the context changed error which is natural as tenant db is not updated.

Regards, Asrar

Hi,

In AddChildPermission when you say fill children do you mean rootPermission.CreateChildPermission or something else? Am sorry having a hard time trying to populate the children. This is what i have so far:

public List<PermissionListDto> GetPermissions()
        {
            var permissions = PermissionManager.GetAllPermissions();
            var rootPermissions = permissions.Where(p => p.Parent == null);

            foreach (var rootPermission in rootPermissions)
            {
                AddChildPermission(rootPermission, permissions);
            }

            List<PermissionListDto> retValue = rootPermissions.MapTo<List<PermissionListDto>>();

            return retValue;
        }

        private void AddChildPermission(Permission rootPermission, IReadOnlyList<Permission> permissions)
        {
            foreach(var child in rootPermission.Children)
            {
//dont know what to do in here
            }
        }
Answer

Resolved it, I had forgotten to add reference to the AutoMapper class.

Question

Hi,

I am using the function below to get a list of all roles:

var _rolesAsync = await _roleRepository.GetAllListAsync();

I am getting the right values here. The return object is List<Role>. How do I convert this object to ListResultDto<RoleListDto> so i can return it to my modal? _rolesAsync does not have a MapTo function hence stuck.

Thanks so much.

Answer

Hi,

Thanks for the response. There was an error in the js file that was causing the issue but thats sorted out.

Question

Hi,

I am trying to implement the EditionManager.

public class EditionManager : AbpEditionManager
    {
        public const string DefaultEditionName = "Standard";

        public EditionManager(
            IRepository<WWEdition> editionRepository, 
            IAbpZeroFeatureValueStore featureValueStore)
            : base(
                editionRepository,
                featureValueStore
            )
        {
        }
    }

WWEdition is the Edition class, that extends Edition from Abp:

public class WWEdition : Edition
    {
        public WWEdition()
        {

        }

        public WWEdition(string displayName)
            : base(displayName)
        {
        }
    }

The error am getting is in EditionManager on WWEdition on editionRepository in base

cannot convert from 'Abp.Domain.Repositories.IRepository<Platform.Editions.WWEdition>' to 'Abp.Domain.Repositories.IRepository<Abp.Application.Editions.Edition>'

Is there something am missing please?

Question

Hi,

Pardon me as am still new to Angular. I am trying to create an Edit Modal for Tenancy. I have created the cshtml and js files. I have added the edit button on the listing page and can get the row id as well. I have added the following code in index.js:

vm.openTenantEditModal = function (tenant) { var modalInstance = $uibModal.open({ templateUrl: '/App/Main/views/tenants/editModal.cshtml', controller: 'app.views.tenants.editModal as vm', backdrop: 'static' }); };

I do hit this function but for some reason the modal is not displayed, no javascript errors are also displayed. In editModal.js I did a consol.log to see if it hits the js file but no luck.

Am i missing something please?

HI,

This is assuming that a DB exists. Can we create the DB for the tenant, if it doesn't exist, when we create the tenant through the interface?

Showing 1 to 8 of 8 entries