Base solution for your next web application

Activities of "Hostmaster"

Hi,

We're upgrading our AspNetZero 6.2 to 10.3.0, using Angular with .Net Core 5.0.

Looking through the xxxAppServiceBase.cs in the .Application project, we know there was a TenantManager and UserManager, and it seemed like a great way to add additional Managers for other core arreas of the system, so we added other Managers for other parts of the system, eg,

public ProductManager ProductManager {get;set;}

Which had the definition of:

public class ProductManager : IDomainService { }

And this worked perfectly within AspNetZero 6.2.

However in 10.3.0, the Manager variables are all NULL and we're not able to get a reference. So if we call

ProductManager.someFunctionCall();

We cannot do this, because ProductManager is null.

Please advise on the changes required to support this.

Regards, Simon Dean

Thanks Musa,

So in the "ApplicationAppServiceBase.cs" under the Application Project:

`public abstract class ApplicationAppServiceBase : ApplicationService { public TenantManager TenantManager { get; set; }

public UserManager UserManager { get; set; }

public SomeOtherManager SomeOtherManager { get; set; }

protected ApplicationAppServiceBase() { LocalizationSourceName = ApplicationConsts.LocalizationSourceName; }

protected virtual async Task<SomeOtherObject.SomeOtherObject> GetSomeOtherObjectAsync(UserIdentifier userIdentifier) { var object = await SomeOtherManager.GetLinkedObjectForUser(userIdentifier); return object; } }`

TenantManager and UserManager are fine, but "SomeOtherManager" is null so we cannot call "GetSomeOtherObjectAsync" because SomeOtherManager is null.

In the code for the manager, we have:

`using System.Linq; using System.Threading.Tasks; using Abp.Domain.Repositories; using Abp.Domain.Services;

namespace ACUTEC.TimeAndAttendance.OtherObject { public class SomeOtherManager : IDomainService { private readonly IRepository<OtherObject, int> _otherObjectRepository;

public SomeOtherManager(IRepository<OtherObject, int> otherObjectRepository) { _otherObjectRepository = otherObjectRepository; }

public async Task

Which seems pretty standard to me.

As I say, this worked absolutely fine in AspNetZero 6.2.0, but not in 10.3.0

Potential difference I see is that other managers now use extend their own interface as well as the ApplicationDomainServiceBase

Ha. I'm an idiot. I forgot to merge in the DbSets to DbContext. Everything's working now.

We're using AspNetZero 10.3, and we have a case where we want to output a number, eg 450, as 7:30. Client needs to be able to sum these up using Excel thus this formatting is particularly useful.

With AspNetZero 6, we were able to output the time as using this function:

double? ConvertMinutesToHHMM(int minutes) { var baseExcelDate = new DateTime(1900, 1, 1, 0, 0, 0); return baseExcelDate.AddMinutes(minutes).ToOADate() - 2; }

and then specify a format as:

        "[h]:mm"
        

Unfortunately it seems that within ASP.NET Zero 10.3, it appears that this no longer works, and despite the formatting being applied to the cell, the cell gets output using NPOI as a double - ie 0.3125.

Any solutions for this?

Hi,

I don't seem to have access to that section of GitHub. Could you advise for me?

Regards, Simon Dean

I figured out how to gain access to the GitHub area. Issue raised.

Hi @rvanwoezik - yes we've tried that, but that doesn't work. Although the style IS set with Excel when you look at the Cell Properties, it displays as a number as 0.3125 as noted above.

Hi,

We've found the need recently to write a couple of services and a native Android ap to hook into AspNet Zero. Essentially we've replicated the Tenant and Login facilities in order to handle some things in the background.

One of the things we need access to, is the granted permissions for the user. The angular implementation appears to be very obscured with a very simple:

abp.auth.grantedPermissions = abp.auth.grantedPermissions || {},

Is there an API call we can do to get a list of granted permissions for the user?

Don't worry about the implementation, all I need to do is find how to call it. And what format the data is in. But I can work that out.

Thanks Simon

Works like a charm, thank you. Though in this case, we need to look at grantedPermissions.

Hi,

We're running AspNetZero 12.0.0 and need a little advice.

Let's say we have an Entity that we modify to make it extend IMustHaveTenant, but we then want to duplicate the existing "Host" level data through each existing Tenant, how best would we achieve this?

I am aware of the DefaultTenantBuilder.cs code and the TenantManager code when creating a new Tenant, but not sure how we would achieve something similar for a first time run on an existing Tenant.

Showing 1 to 10 of 11 entries