Base solution for your next web application

Activities of "Hostmaster"

Yes, it's a tricky one to explain.

We had an existing entity on our multi tenant application, eg, Options:

namespace MyProject.Option
{
    [Table("Options")]
    public class Option : AuditedEntity
    {
    }
}

But we decided that we needed to allow the tenant user to be able to customise these options so we changed this to:

namespace MyProject.Option
{
    [Table("Options")]
    public class Option : FullAuditedEntity<int>, IMustHaveTenant
    {
    }
}

So now we have the problem that the entries were present at the host level, now are not seen at the Tenant level, so we need a magic way to insert those host entries against each client at the tenant level - either as part of the Migration stage, or as part of the login through TenantManager or otherwise?

I'm just having a look over Data Seeding.

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.

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

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

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.

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

Hi,

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

Regards, Simon Dean

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?

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

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

Showing 1 to 10 of 11 entries