Base solution for your next web application

Activities of "jtallon"

Question

Hi, Is there any more information regarding caching with Redis? I'm following this guide here but there is no information on what layers they dtos etc should live https://aspnetboilerplate.com/Pages/Documents/v2.0.0/Caching

Any help appreciated.

Hi Team,

We are about to kick start a major upgrade of a project which is using the older ASPNETZERO Package to the latest version which supports .NET 6, but with .NET 7 released the team is curious how soon a version of ASPNETZERO is planned which is based on .NET 7.

Can you give us a concrete idea about the estimated timeline, I can see ABP is already working on a .NET 7 RC version which is good for other project where we are using ABP but need a clarity on this project as well.

Regards, Ali Storm

  • What is your product version? 10.2.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net Core

I'm trying to add a single column (RoleId) to UserOrganizationUnit I've created a class public class OrganizationUnitRole_Extended : UserOrganizationUnit { public virtual Role Role { get; set; } public int RoleId { get; set; } }

I've added it to the dbcontext public virtual DbSet<OrganizationUnitRole_Extended> OrganizationUnitRole_Extended { get; set; }

However my migrations add in a discriminator column.

Is there any way to avoid this? I've read that fluent api could resolve it but I haven't figured out how to do it properly.

What is your product version? 10.2.0 What is your product type? Angular What is product framework type? .net core

I created a simple interface IWorkerInterface where I use a Dto which exists in my service-proxies.

export class UserLookupTableDto implements IUserLookupTableDto

However in VS Code when I go to import that type it tells me "Cannot find name 'UserLookupTableDto'.ts(2304)'

A workaround is to go to another ts file an import the new IWorkerInterface. Once this is done I can successfully fix the import import { UserLookupTableDto } from "@shared/service-proxies/service-proxies";

Can you think of any reason why this might happen? I've run "Restart TS Server" and I've done a bunch of refresh.bat and I've also restarted my machine...

  • What is your product version? 10.2.0
  • What is your product type? Angular
  • What is product framework type? .net core

I have a parent entity with a list of child objects. On the UI I load up the parent screen with a list of child objects. I edit one of the child objects attributes. I call createOrUpdate on the parent object and pass everything correctly to the API.

I call parentRepository.GetAllIncluding(x=>x.children).FirstOrDefault( s=>s.Id == input.Id.Value);

I also call: ObjectMapper.Map(input, parentObject); var children = new List<LinkedChildren>(); ObjectMapper.Map(input.Children, children); parentObject.Children = children; await parentRepository.UpdateAsync(parentObject);

The Parent entity has public virtual List<LinkedChildren> Children { get; set; }

The Child entity has [Table("Children")] public class Children : FullAuditedEntity<Guid> { [Required] public virtual int ParentId { get; set; } [ForeignKey("ParentId")] public virtual Parent Parent { get; set; }

I can create the children however when I save after that the children become IsDeleted = 1

What is your product version? 10.2.0

What is your product type (Angular or MVC)?Angular

What is product framework type (.net framework or .net core)? .net core

RAD Power tool version 3.1.1


Hi,

Recreation steps:

I created a new entity with a single property (DateTime) using the RAD Power tool. I then picked 1st Jan 1970 as the date when creating the new entity with the UI generated by the RAD Power tool. The date is saved incorrectly as "1969-12-31 23:00:00.0000000" in the database.

I tried the same with 1st Jan 1971 and it saved incorrectly as "1970-12-31 23:00:00.0000000" in the database.

Then I tried 1st Jan 2022 and it saved correctly as "2022-01-01 00:00:00.0000000"

Are you aware of this bug and how it may be fixed?

Though debugging I can see that the fault lies in the UI , the API is receiving the wrong date through the REST call.

Prerequisites

  • What is your product version? 10.2.0

  • What is your product type (Angular or MVC)?Angular

  • What is product framework type (.net framework or .net core)? .net core

    Hi,

    Looking to add custom policy and requirement based authorization to asp net zero as per: https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies?view=aspnetcore-6.0#iauthorizationservice

It is working as intended but when i try to access a default repository to check for some values it seems like it hasn't been registered and I get an error:

I'm using constructor parameter injection in the requirement handler.

System.ArgumentNullException: Value cannot be null. (Parameter 'unitOfWork') at Abp.EntityFrameworkCore.Uow.UnitOfWorkExtensions.GetDbContext[TDbContext](IActiveUnitOfWork unitOfWork, Nullable1 multiTenancySide, String name) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetContext() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.<GetQueryableAsync>b__8_0(Type key) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetQueryableAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllIncludingAsync(Expression1[] propertySelectors) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.FirstOrDefaultAsync(TPrimaryKey id) at TCM.Web.Startup.Authorization.TeamMemberAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, TeamMemberRequirement requirement) in C:\Users\EKeane\source\repos\TCM\aspnet-core\src\TCM.Web.Host\Startup\Authorization\TeamMemberAuthorizationHandler.cs:line 66 at Microsoft.AspNetCore.Authorization.AuthorizationHandler1.HandleAsync(AuthorizationHandlerContext context) at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable1 requirements) at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, Object resource) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Any help appreciated

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 9.2
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version? 5.10.1

Im trying to leverage Event Bus to fire Custom Domain Events but looks there is some problem and the subscribed handlers are not receiving the event data. Below is a s sample of code of what I am doing.

https://aspnetboilerplate.com/Pages/Documents/EventBus-Domain-Events

` /* SAMPLE CODE */

public class InspectionFailedEventData : EventData
{
    // Few Properties which will be part of Event Data
}

public interface IInspectionFailedEventManager : IEventHandler&lt;InspectionFailedEventData&gt;, ITransientDependency
{
    // Interface for Handlers
}

public class SendEmailOnInspectionStatusChange : IInspectionFailedEventManager
{
    // First handler (Subscription) for the event data
    private readonly IEmailTemplateProvider _emailTemplateProvider;
    private readonly ISiteRepository _siteRepository;
    private readonly IEmailSender _emailSender;
    private readonly IRepository&lt;Capture, Guid&gt; _captureRepository;
    private const string TemplateName = "InspectionCompleteEmailTemplate";

    public SendEmailOnInspectionStatusChange(IEmailTemplateProvider emailTemplateProvider,
        ISiteRepository siteRepository,
        IEmailSender emailSender,
        IRepository&lt;Capture, Guid&gt; captureRepository)
    {
        _emailTemplateProvider = emailTemplateProvider;
        _siteRepository = siteRepository;
        _emailSender = emailSender;
        _captureRepository = captureRepository;
    }

    public void HandleEvent(InspectionFailedEventData eventData)
    {
        var captureDetails = _captureRepository.GetAllIncluding(s => s.CaptureTemplate)
            .Include(s => s.CaptureTemplate)
            .FirstOrDefault(s => s.Id == eventData.InspectionId);
        if (captureDetails != null)
        {
            var templateForStatusChange = _emailTemplateProvider.GetTemplate(eventData.TenantId, TemplateName);
            templateForStatusChange = templateForStatusChange.Replace("{Material}", captureDetails.CaptureTemplate.ItemName);
            templateForStatusChange = templateForStatusChange.Replace("{ItemNumber}", captureDetails.SMPItemNumber);
            templateForStatusChange = templateForStatusChange.Replace("{SMPLotNumber}", captureDetails.SMPLotNumber);
            templateForStatusChange = templateForStatusChange.Replace("{CompletedUser}", eventData.UserName);
            templateForStatusChange = templateForStatusChange.Replace("{StatusColour}", eventData.InspectionPassed ? "green" : "red");
            templateForStatusChange = templateForStatusChange.Replace("{MaterialStatus}", ((CaptureStatusEnum)captureDetails.CaptureStatusId).ToString());

            var wareHouseEmail = _siteRepository.Get(eventData.TenantId).WarehouseDistributionEmail;

            if (string.IsNullOrEmpty(wareHouseEmail))
            {
                throw new EntityNotFoundException("No email sent. Warehouse email was not set for this site");
            }

            _emailSender.SendAsync(new MailMessage
            {
                To = { wareHouseEmail },
                Subject = "Inspection Complete",
                Body = templateForStatusChange,
                IsBodyHtml = true

            });
        }
    }
}

public class SendStatusToQadOnInspectionStatusChange : IInspectionFailedEventManager
{
    // Second handler (Subscription) for the event data
    private readonly IQadIntegrationAction _qadIntegrationAction;

    public SendStatusToQadOnInspectionStatusChange(IQadIntegrationAction qadIntegrationAction)
    {
        _qadIntegrationAction = qadIntegrationAction;
    }

    public void HandleEvent(InspectionFailedEventData eventData)
    {
        var stockInboundMessage = new QadStockInboundMessage()
        {
            Id = eventData.Id,
            ExpiryDate = eventData.ExpiryDate,
            Status = eventData.InspectionPassed ? QadStatus.Available : QadStatus.Quality
        };

        _qadIntegrationAction.SendStockUpdateToServiceBusAsync(stockInboundMessage);
    }
}

// AppService
public async Task&lt;string&gt; SetInspectionStatus(SetInspectionStatusDto input)
    {
        var user = await GetCurrentUserAsync();
        var tenant = await GetCurrentTenantAsync();
        var userName = user.FullName;
        var hasInspectionPassed = CheckIfCaptureHasPassed(input.CaptureId);
        capture.CaptureTypeLockId = null;
        capture.ReleasedTime = DateTime.UtcNow;
        capture.ReleasedById = (await GetCurrentUserAsync()).Id;
        if (!hasInspectionPassed)
        {
            capture.CaptureStatusId = (int)CaptureStatusEnum.ReleaseFailed;
        }

        // Event Data Creation
        var eventData = new InspectionFailedEventData
        {
            Id = capture.GRN,
            InspectionId = capture.Id,
            InspectionPassed = hasInspectionPassed,
            ExpiryDate = capture.ExpiryDate,
            UserName = userName,
            TenantId = tenant.Id
        };

        // EventData passed to a Domain Service with some extra info
        await _inspectionEventManager.TakeActionOnInspectionFailAsync(eventData, user, tenant);
        return CaptureStatusEnum.Release.ToString();
    }

    // DomainService
    class InspectionEventManager : PortalDomainServiceBase, IInspectionEventManager
    {
        public IEventBus EventBus { get; set; }

        public InspectionEventManager()
        {
            EventBus = NullEventBus.Instance;
        }

        public async Task TakeActionOnInspectionFailAsync(InspectionFailedEventData eventData, User user1, Tenant tenant)
        {
            await EventBus.TriggerAsync(this, eventData);
        }
    }
 `

Nothing happens when TriggerAsync method is called, and I cant figure out a way to debug or resolve it.
Question

Version9.0.1 Angular .net core

Running an AMD Ryzen 5 3600 with 32gb Ram.

Is there anything I can do to speed it up? npm start takes 3min 52sec

The logs are: Dynamic bundles are being created. [14:18:58] Finished 'buildDev' after 1.57 min Then it does another building where it takes the duration. One file sticks out and takes particularly long 69% building 1139/1140 modules 1 active ...js??ref--13-3!C:\Users\jtallon\source\repos\XYZ\Portal\angular\src\app\shared\layout\themes\kendo\theme.scss

Is this to be expected? We accept it but I wonder if it can be quickened even more. AOT is off for Dev which is handy for rebuilds of simple pages.

We upgraded from 6.8 to 9.0.1 Angular .net core

Since then our rebuilds are much slower. A simple HTML change can take up to 30 seconds or longer to compile and refresh the webpage. Before it used to take a few seconds. Running an AMD Ryzen 5 3600 with 32gb Ram.

Is there anything I can do to speed it up?

Showing 1 to 10 of 33 entries