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

Activities of "rickfrankel"

Prerequisites

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

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

Hey Team,

Just trying to work out how the authentication to the public website works. Does it share the same login information as with the Angular site. Eg: If I'm already logged into the angular site and I navigate over to the public site will they share the same login information (assuming they run under the same base domain eg: app.mysite.com www.mysite.com

Was hoping the cookies from the app.mysite.com would mean that you're already automatically logged in to the public site.

It would seem however that this may not be the case and some returnurl magic happens?

Thanks Rick

Prerequisites

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

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

https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/app/admin/webhook-subscription/create-or-edit-webhook-subscription-modal.component.ts#L82 should be

    this.webhookSubscription.webhooks = this.webhooks.map(wh => wh.value);

instead of this.webhookSubscription.webhooks = this.webhooks.map(wh => wh.name);

If you specify a display name which is friendly and not the same as the value in the Webhook Definition then you won't be able to create them without changing the line above.

Thanks Rick

Prerequisites

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

  • What is your product version?
  • 10.3
  • 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? 6.3.1 also running Abp.AspNetCore.PerRequestRedisCache - 1.0.0

When using the maintenance screens to clear all cache or any individual cache you get the below exception. Also looking at the code here https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore.PerRequestRedisCache/Runtime/Caching/Redis/AbpPerRequestRedisCache.cs

It doesn't appear as though the redis cache is cleared at all. It just looks to clear the HttpContext per reqeust cache.

Ideally it should be doing both I would think?

ERROR 2021-06-23 13:57:44,733 [33 ] Mvc.ExceptionHandling.AbpExceptionFilter - Unable to cast object of type 'System.Object' to type 'System.String'. System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.String'. at Abp.Runtime.Caching.Redis.AbpPerRequestRedisCache.Clear() at Abp.Runtime.Caching.AbpCacheBase.ClearAsync() at Inbound.Caching.CachingAppService.ClearAllCaches() in C:\Source\Inbound\aspnet-core\src\Inbound.Application\Caching\CachingAppService.cs:line 44 at lambda_method6307(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • What is ABP Framework version?
  • 6.3.0

As per the release notes here https://github.com/aspnetboilerplate/aspnetboilerplate/releases/tag/v6.1.0

It would suggest that this issue is resolved and available in 6.1.0 https://github.com/aspnetboilerplate/aspnetboilerplate/pull/5910

However. Per that pull request it was only ever merged into Dev and it does not look like the AbpPerRequestRedisCache is available in 6.1.0 or 6.3.0 which is the version I'm currently using.

We're currently having a lot of issues with Redis which we hope this will resolve.

Are you able to advise what the plans are here?

Thanks

Hi,

I have the ASP.Net Core & Angular package. I'm running 8.7 (just saw 8.8 released. Upgrade for another day).

I just noticed that on the Web.Public site the Error handler doesn't appear to exist.

Eg: If I go to our site with a made up page to generate a 404 you get this.

ERROR 2020-05-25 10:36:47,018 [20 ] AspNetCore.Server.IIS.Core.IISHttpServer - Connection ID "18374686481282236522", Request ID "8000006b-0000-ff00-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.InvalidOperationException: The view 'Error404' was not found. The following locations were searched: /Views/Error/Error404.cshtml /Views/Shared/Error404.cshtml

This is in the startup.cs

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseStatusCodePagesWithRedirects("~/Error?statusCode={0}");
            app.UseExceptionHandler("/Error");
        }

However I don't see any Controller or Views for /Error?

Thanks Rick

Hi,

I have a situation where I need to disable the tenant filters and then optionally manually add a filter on the tenant ID.

I do it as follows.

Wrap my code in using (UnitOfWorkManager.Current.DisableFilter(AbpDataFilters.MustHaveTenant, AbpDataFilters.MayHaveTenant)) {

Then do a var query = repo.GetAll() .Include(a bunch of related tables). etc

Further down in my logic with the IQueryable I will add in the following.

query.Where(_ => _.TenantId == AbpSession.TenantId.Value)

When I execute that query the TenantID filter is NOT enforced as I expect it to be.

The DisableFilter appears to overrule any manually added TenantId filter.

Is this expected? How do I get around this?

I feel like I'm missing something here.

Hi,

I'm trying to create and send a notification from a tenant to the host account.

I'm using the following code to publish the notification from within the context of my tenant account. await _notificationPublisher.PublishAsync(AppNotificationNames.MyNotification, notificationData);

I've noticed that it get's inserted into AbpNotifications correctly and then the Hangfire job runs to distribute it.

I've traced through the Abp code and found https://github.com/aspnetboilerplate/aspnetboilerplate/blob/c0604b9b1347a3b9581bf97b4cae22db5b6bab1b/src/Abp/Notifications/DefaultNotificationDistributer.cs

My issue is this section I believe (line 187 in GetUsers method)

            if (tenantIds.IsNullOrEmpty() ||
                (tenantIds.Length == 1 && tenantIds[0] == NotificationInfo.AllTenantIds.To&lt;int&gt;()))
            {
                //Get all subscribed users of all tenants
                subscriptions = _notificationStore.GetSubscriptions(
                    notificationInfo.NotificationName,
                    notificationInfo.EntityTypeName,
                    notificationInfo.EntityId
                    );
            }
            
            

When I trace the DB call here I can see that the GetSubscriptions call is made in the context of the tenant that originally created the notification. Thus even though my host users are subscribed to that NotificationName it will never receive it. This is also strange because the GetSubscriptions code has this.

 [UnitOfWork]
    public virtual List&lt;NotificationSubscriptionInfo&gt; GetSubscriptions(string notificationName, string entityTypeName, string entityId)
    {
        using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant))
        {
            return _notificationSubscriptionRepository.GetAllList(s =>
                s.NotificationName == notificationName &&
                s.EntityTypeName == entityTypeName &&
                s.EntityId == entityId
                );
        }
    }

So it should disable the filter. However this is my DB log (I've sanitized and cleaned it up a little).

@__ef_filter__p_0='False', @__ef_filter__CurrentTenantId_1='2' (Nullable = true), @__notificationName_0='App.MyNotifications' (Size = 96)], CommandType='Text', CommandTimeout='60'] SELECT a.Id, a.CreationTime, a.CreatorUserId, a.EntityId, a.EntityTypeAssemblyQualifiedName, a.EntityTypeName, a.NotificationName, a.TenantId, a.UserId FROM AbpNotificationSubscriptions AS a WHERE (@__ef_filter__p_0 OR (a.TenantId = @__ef_filter__CurrentTenantId_1)) AND (((a.NotificationName = @__notificationName_0) AND a.EntityTypeName IS NULL) AND a.EntityId IS NULL)

You can see that the first paramater is false which means it is checking for the TenantId.

The distributer essentially cannot find any users subscribed to that notification and thus just delete's my abpnotifications row.

Is there any way around this. Is this expected behaviour.

I'm not sure why I'm seeing this behaviour.

Cheers Rick

All,

After upgrading to .Net Core 3.0 version yesterday I have to say that Entity Framework for .Net Core 3.0 is not ready and I'd advise holding off on upgrading.

Here are a few of the issues I've encountered with my upgrade.

https://github.com/aspnet/EntityFrameworkCore/issues/18090 https://github.com/aspnet/EntityFrameworkCore/issues/18510

They are really basic issues that appear to be fixed in pre-release versions.

I have managed to fix it up by upgrading the Host project to the pre-release Entity Framwork Core version but it's not a great solution.

It looks like everyone is holding off at the moment for 3.1 of the Entity Framework Core version.

If anyone else has better lucky would love to hear it.

Be great to see if Abp an upgrade to a pre-release version to get around these issues.

Cheers Rick

Hi,

I have a custom entity that has multiple foreignkeys to user. Even after including them in the query they don't populate.

EG:

If I have an Order entity defined as (simplified for example)

[Table("Orders")] [Audited] public class Order : FullAuditedEntity, IMustHaveTenant {

    public int TenantId { get; set; }
    [ForeignKey("TenantId")]
    public virtual Tenant TenantFk { get; set; }
    public virtual bool Completed { get; set; }
    public virtual long? CompletedById { get; set; }

    [ForeignKey("CompletedById")]
    public virtual User CompletedByFk { get; set; }

    public virtual bool Canceled { get; set; }
    public virtual long? CanceledById { get; set; }

    [ForeignKey("CanceledById")]
    public virtual User CanceledByFk { get; set; }
}


When I load up the order using an IRepository&lt;Order&gt; and Include(_ => _.CompletedByFk) for example.  It never populates the CompletedByFk object, even though the CompletedById has a value and it maps to a valid row in that AbpUsers table.

Any thoughts?

Thanks
Rick

Hi,

When using the RAD tool to generate UI for entities. The paging on the UI doesn't appear to work correctly.

ASP.NET CORE & Angular .NET Core 2.2 v7.1.0

It appears as tho the rows value is hard coded to 5. I've tried all sorts of methods to try and change it, but not having a lot of luck.

I've changed the rows= value in two spots in the html files and remove the hard coded setting of it to 5 in the .ts files.

Am I missing something? I want a default page size of 100. I've set this up and all existing pages are working fine, however any newly created ones with the RAD tool do not work.

Thanks Rick

Showing 31 to 40 of 41 entries