Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "bilalhaidar"

Thanks a lot for the detailed explanation :-) I must start learning new stuff now ;)

Hello @strix20, Thanks for the elaboration!

I am using Azure as my client has an account there and we need to utilize it. Otherwise, I don't mind AWS. Maybe I should give it a try and test it out as you talked very well about it.

I have a question for you on this regard. How do you develop your app in such a way that it can run locally and on Azure at the same time given that you are making use of Service Bus and BLOB? Do you use Conditional Compilation for that?

Also, what was the case for you to need to use Service Bus? Like just the headline only, why would I use that thing.

Thanks a lot Bilal

Thank you for your responses.

@strix20: What is the suggestion on Azure, what to use? BLOB storage?

@ismcagdas Is there a plan to make the ASPNETZERO compatible more with Azure?

Thanks

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

For anyone in the same situation as mine. I found a way out.

In the VSTS Build Definition, select .csproj instead of .sln. This way, only the project you want to build, will be built, others won't!

This works like a charm. If you need help while doing this step, ping me here. I will be glad to help.

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

Thank you Ismail for your quick response. That was it, and here is the code I used and it works in case someone needs it:

var pages = context.GetPermissionOrNull(AgencyPermissions.Pages);
            var common = pages.Children.Where( permission => permission.Name.Equals(AgencyPermissions.Common, System.StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
            
            if (common == null)
            {
                return;
            }

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

Sure. I'll send you the project via email.

Thanks for your assistance.

Hello, I tried both codes below. Still nothing is saved in the AbpUserNotifications :(

I am also attaching to you a snapshot from the SQL Profiler. It shows no commands to SQL to actually insert a new record into the AbpUserNotifications.

Can I debug the Notification engine from my machine and see whats happening?

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

And

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

Showing 51 to 60 of 635 entries