Base solution for your next web application

Activities of "bilalhaidar"

Hi, I am trying to integrate Workflow Foundation to ASPNETZERO, basically on the AppService level.

I just need your guidance when it comes to organizing the code.

Shall I create a new Class Library with a Module, add all the Workflow code there, and then add this module as a dependency on the AppService module? Would that work fine? Or there are other considerations I am not able to see in here?

Thanks Bilal

Question

Hello,

I would like to ask about the tool that was used to generate the .nswag file with the option to generate client-side code based on a Swagger Uri as it is the case now.

I am sorry for asking this question here, but I tried to search online for such thing and I wasn't lucky, and since it is being used in the template, I thought of seeking your help.

Thank you for time.

Hello, The template uploads files to a subfolder (Temp) in the solution folder. In case the application is to be hosted on Azure, shall I use BLOB instead, or this current solution would work fine?

In case of BLOB then I will have the image/file uploaded stored as is on file system and maybe with the name of the file stored in the Db.

Thanks Bilal

Hi, I have setup a continuous integration in VSTS and all is working fine and the web app is published successfully. However, I noticed that in the files that were published into Azure, there is only 1 appsettings.json file. This is the one for the Public website rather than for the backend one (Web.Host).

What shall I do? How could I publish the Web.host and Web.public to two different web apps so that each web app gets its own copy of the appsettings.json?

Thanks

Hello,

In the AppServiceModule project I am adding 2 AuthorizationProviders. The first creates a root node under "Pages" called "Pages.Common" and the second create new permissions under "Pages.Common". The code is as follows:

Configuration.Authorization.Providers.Add<SharedAuthorizationProvider>();
Configuration.Authorization.Providers.Add<AgencyAuthorizationProvider>();

In the SharedAuthorizationProvider:

public static class SharedPermissions
    {
        public const string Pages = "Pages";

        public const string Common= "Pages.Common";
    }

public class SharedAuthorizationProvider : AuthorizationProvider
    {
        private readonly bool _isMultiTenancyEnabled;

        public SharedAuthorizationProvider(bool isMultiTenancyEnabled)
        {
            _isMultiTenancyEnabled = isMultiTenancyEnabled;
        }

        public SharedAuthorizationProvider(IMultiTenancyConfig multiTenancyConfig)
        {
            _isMultiTenancyEnabled = multiTenancyConfig.IsEnabled;
        }

        public override void SetPermissions(IPermissionDefinitionContext context)
        {
            var pages = context.GetPermissionOrNull(SharedPermissions.Pages);
            pages.CreateChildPermission(SharedPermissions.Common, L("Common.Permission"));
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, DrcAppConsts.LocalizationSourceName);
        }
    }

In the AgenciesAuthorizationProvider:

public static class AgencyPermissions
    {
        public const string Common = "Pages.Common";

        public const string Agency = "Agency";
...

   public class AgencyAuthorizationProvider : AuthorizationProvider
    {
        private readonly bool _isMultiTenancyEnabled;

        public AgencyAuthorizationProvider(bool isMultiTenancyEnabled)
        {
            _isMultiTenancyEnabled = isMultiTenancyEnabled;
        }

        public AgencyAuthorizationProvider(IMultiTenancyConfig multiTenancyConfig)
        {
            _isMultiTenancyEnabled = multiTenancyConfig.IsEnabled;
        }

        public override void SetPermissions(IPermissionDefinitionContext context)
        {
           **var common = context.GetPermissionOrNull(AgencyPermissions.Common);**

            var agency = common.CreateChildPermission(AgencyPermissions.Agency, L("Agency.Permission"));

In the line of code above that is bold: "common" is being null.

Is there something wrong in the code written or the library doesn't allow creating parent and child on the fly?

Thanks

Hello, I configure my app to run with HangFire. I can see a job being enqueued. The job is making use of the NotificationPublisher to send a notification to a specific user (testing purpose). The user is never receiving those notifications.

I debugged the code and it works fine.

I also checked the AbpTenantNotifications, it seems those notifications used are not added to the DB.

public class TestingHangFireDomainService : DrcAppDomainServiceBase, ITestingHangFireDomainService
    {
        private readonly IAppNotifier _appNotifier;
        private readonly IUnitOfWorkManager _unitOfWorkManager;
        private readonly UserManager _userManager;

        public TestingHangFireDomainService(IAppNotifier appNotifier, UserManager userManager, IUnitOfWorkManager unitOfWorkManager)
        {
            _appNotifier = appNotifier;
            _unitOfWorkManager = unitOfWorkManager;
            _userManager = userManager;
        }

        public async Task NotifyUser()
        {
            using (_unitOfWorkManager.Begin())
            {
                var user = _userManager.Users.Where(u => u.Id == 2).FirstOrDefault();
                await _appNotifier.SendMessageAsync(user.ToUserIdentifier(), "Testing HangFire", Abp.Notifications.NotificationSeverity.Info);
            }
        }
    }

Hello, The project is configured such that canActivate and canActivateChild both run the same code. If I want to run a specific permission check on a specific route, can I override the canActivateChild or canActivate using a new guard?

Thanks

Hello, The project I am working on is using .NET 4.6.1 (ASP.NET Core + Angular 2). If I want to switch and start using the one based on .NET Core, can I just download a new copy of the project and move my files there, or are there more major changes to be done?

Note that I do understand that I will lose the SignalR and LDAP features.

Thank you Bilal

Hello, Is the filter IPassivable enabled by default? I noticed today that the query is returning IsActive is true and those that have it as false.

Where can I check more info about that?

Thanks

Hello,

How to add a new language translations? Just add a new .xml file with the language code at the end similar to what you have done?

Is there a way also to separate my translations into another folder and rerference them in the project? This makes upgrading to newer version of the framework easier.

Thanks

Showing 11 to 20 of 174 entries