Base solution for your next web application

Activities of "dexmox"

Hi All,

Thank you in advance.

I am looking for the best way to include Idle Timer / Session Timeout into an Angular + Core Zero project.

What is the best way to handle logout after a session time is reached - configurable per tenant (stored in a settings table) that will display a lockout modal and stop any further action / navigation until they log back (including if they press refresh).

If anyone could provide an example / provide a link to an implementation or point me the general direction.

Thank you kindly. Regards. Dex.

Hi All,

I have looked through the forum for an example but I dont understand how to implement it.

Could someone please provide some detailed steps for importing and using the external-events from metronic into angular SPA?

Thank you kindly in advance for any and all assistance.

Kindest Regards, Dex

When will V7 be ready for download from aspnetzero site as it has been completed in github ?

Thanks in advance.

Could someone please tell me what the benefits and differences are and which is better to use for doing ajax table updates and why ?

_personService.createPerson(person).done(function () {
                _modalManager.close();
                 // some ajax table updates and stuff here
            }).always(function () {
                _modalManager.setBusy(false);
            });

https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Developing-Step-By-Step-Core-Saving-Person

VS

abp.ajax({
    url: '/People/SavePerson',
    data: JSON.stringify(newPerson)
}).done(function(data) {
    abp.notify.success('Created new person with id = ' + data.personId);
    // some ajax table updates and stuff here
});

https://aspnetboilerplate.com/Pages/Documents/Javascript-API/AJAX

Thanks in advance.

Power Tools 2.0.2.1 - Is it possible to create views only from manually created Model/Entity

Example:

  1. Created an entity without powertools.
  2. Created API without powertools
  3. Want to generate index, edit, create

Let me know if i need to be more specific about what i am trying to achieve.

Issue: AppService is inserting 3 rows instead of one.

What I am trying to achieve is a link table for many to many relations between 3 entities. It appears to be creating one of each type of link between the three entities,

A true fale A false true A true true

But I dont understand why, any assistance would be greatly appreciated and thanks in advance. I believe this may have more to do with EF Core but I am not sure whats wrong here.

public class ModelOne : FullAuditedEntity<long>, IMustHaveTenant
{
        public virtual int TenantId { get; set; }
        public virtual ICollection<ResLink> ResLinks { get; set; }
}
public class ModelTwo : FullAuditedEntity<long>, IMustHaveTenant
{
        public virtual int TenantId { get; set; }
        public virtual ICollection<ResLink> ResLinks { get; set; }
}
public class ModelThree : FullAuditedEntity<long>, IMustHaveTenant
{
        public virtual int TenantId { get; set; }
        public virtual ICollection<ResLink> ResLinks { get; set; }
}
public class ResLink : FullAuditedEntity<long>, IMustHaveTenant
{
        public virtual int TenantId { get; set; }
        
        public virtual long? ModelOneId { get; set; }
        public virtual ModelOne ModelOne { get; set; }
   
        public virtual long? ModelTwoId { get; set; }
        public virtual ModelTwo ModelTwo { get; set; }
        
        public virtual long? ModelThreeId { get; set; }
        public virtual ModelThree ModelThree { get; set; }      
}
public async Task CreateResLink(CreateResInput input) {
    foreach (var resInput in input.ResLinks)
    {    
        var res = new ResLinkDto
        {
            TenantId = AbpSession.TenantId.Value,    
            ModelOneId = resInput.modelOneId,            
            ModelTwoId = resInput.modelTwoId,
            ModelThreeId = resInput.modelThreeId.    
        };

        await _resLinkRepository.InsertAsync(ObjectMapper.Map<ResLink>(res));
    }
}

Insert Result: ID Date User Id M.Date M.User IsDeleted D.Uid D.Time TenantId ModelOneId ModelTwoId ModelThreeId 30050 06/08/2019 13:26:54 6 NULL NULL False NULL NULL 1 1 NULL 180026 30051 06/08/2019 13:26:54 6 NULL NULL False NULL NULL 1 NULL 1 180026 30052 06/08/2019 13:26:54 6 NULL NULL False NULL NULL 1 1 1 180026

Yep, only being called once via abp.services.app.xxx AppService gets only one object from input, and loops only once and inserts 3.

Edit -- sorry it is in a for loop and the input is only one object being passed in, will update the original post too.

foreach (var resInput in input.ResLinks)
{    
    var res = new ResLinkDto
    {
        TenantId = AbpSession.TenantId.Value,    
        ModelOneId = resInput.modelOneId,            
        ModelTwoId = resInput.modelTwoId,
        ModelThreeId = resInput.modelThreeId.    
    };
    
    await _resLinkRepository.InsertAsync(ObjectMapper.Map<ResLink>(res));
}

@demirmusa - thanks, for your assistance the cause was automapper higher up the chain - I added a collection to a dto earlier, forgot about it and automapper just included it. Thank you again.

Hi Again,

Thanks in advance.

What would cause throw new UserFriendlyException to not display a popup with the message in one section of my app but show the popup in another ?

They both log to log.txt

Sorry for being unclear, please let me know if this helps clarify

I am trying to throw an exception from AppService

public async Task Example1(EntityDto<long> input)
{
    throw new UserFriendlyException(L("AlreadyExists"));
}

called with abp.services.app in a datatable rowAction item

abp.services.app.exampleItems.Example1({ id: data.record.id }).done(function () {
    // on done callback  
}).always(function () {
    // always callback
});

AppService throws error to log file, but does not show alert box on UI.

However another app service throws the same exception and it works, is being called using abp.services.app aswell but it is not in a datatable rowAction.

Showing 1 to 10 of 49 entries