Base solution for your next web application

Activities of "lweng567"

Question

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

What is your product version? Lastest Zero What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? .netCore

Hi, In my create method, i need to first create an entity and then use the entity Id to do non-transactional activity (for example, write to a file), so I use repository<MyEntity>.InsetAndGetIdAsync to return the Id. My understanding is InsertAndGetIdAsync will commit the transaction and write the record to the database. But to my supprise, although InsertAndGetIdAsync returns a correct Id, but not database record is created if writing out the id to a file fails (means rollback), when i look at the abpEntityChange audit, the record change was actually logged with the correct Id. I thought if the file writing fails and record writing to the database was rollback, then the audit should not have been written, otherwise, user can see the audit but could not find the record.

Question

Prerequisites

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

  • What is your product version? 9.3.0
  • 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? Zero

If issue is about UI

  • Which theme are you using?
  • What are the theme settings?

I am seeking some advice here. I have an application with many Entities and some of them are shared entities. For example, A Person entity has list of Note entities, and a Business entity also has a list of Note entities. User can create, update or delete ( the usual CRUD) Note for both Person and Business entity. In this situation, i can inject Note repository or Note Manager to PersonAppService and BusinessAppService to do all CRUD operation for Note entity, but I will have to repeat myself in two places. I was thinking of creating a common service for Note entity and inject only the commone service to PersonAppService and BusinessAppService, so I dont need to repeat myself. But then the common service will not be able to extend the BaseAppService and use ObjectMapper etc... Can you please shed some light on what will be the best practice on this?

Laurie

I think I know why, because AD integration requires user to have an email address. After I assigned an email address to the AD user, i can log in and created an user in my Zero app now.

INFO 2020-10-14 16:12:19,442 [37 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "Authenticate", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[FinesseNx.Web.Models.TokenAuth.AuthenticateResultModel] Authenticate(FinesseNx.Web.Models.TokenAuth.AuthenticateModel) on controller FinesseNx.Web.Controllers.TokenAuthController (FinesseNx.Web.Core). ERROR 2020-10-14 16:12:26,090 [4 ] Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Abp.Authorization.Users.AbpUser1.SetNormalizedNames() at Abp.Authorization.AbpLogInManager3.TryLoginFromExternalAuthenticationSourcesAsync(String userNameOrEmailAddress, String plainPassword, TTenant tenant) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.AbpLogInManager3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.AbpLogInManager3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at FinesseNx.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Web Dev\FinesseNx-Main\aspnet-core\src\FinesseNx.Web.Core\Controllers\TokenAuthController.cs:line 649 at FinesseNx.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model) in C:\Web Dev\FinesseNx-Main\aspnet-core\src\FinesseNx.Web.Core\Controllers\TokenAuthController.cs:line 138 at lambda_method(Closure , Object ) at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult() at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.In

Prerequisites

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

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

I followed the documentation to enable Active Directory integration,

  1. Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));
  2. in the user setting, update Ldap setting accordingly.

when i tried to log in using my AD account, i got a System.NullReferenceException in the GetLoginResultAsync in TokenAuthController. Can you please advise if there is anything else i need to set up

thanks Laurie

Prerequisites

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

  • What is your product version? Zero V9.1.0 the latest
  • 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? Zero

Hi there,

I am trying to use Redis to implement "recently viewed items" functionality. By reading the zero documentatoin, the cache is expired in 60 minutes by default although i can change the the expiry span to more hours. If the whole cache is expired then all the items within the cache will be expired, but for the "recently viewed items" functionality, i just need to expire the item with least score not the entire cache, please advise if my understanding is correct on the cache implemtation provided by Zero, if i am correct, then would you be able to provide some advise on how i should impliment the " recently viewed items" by leveraging Redis within Zero? Many thanks Laurie

Hi,

I later figured out that in the one solution template, there is no HomeController. There is a HomeController in seperate solutions template.

In the HomeController, the Index has redirection to swagger. public IActionResult Index() { return Redirect("/swagger");

    }

Hi,

This is what I have in the Startup.cs file.

public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { app.UseAbp(options => { options.UseAbpRequestLocalization = false; }); // Initializes ABP framework.

        app.UseCors(_defaultCorsPolicyName); // Enable CORS!
        

//======= added the following line to run angular and .net core in single Site

        app.Use(async (context, next) => { await next(); 
        if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value) && !context.Request.Path.Value.StartsWith("/api/services", StringComparison.InvariantCultureIgnoreCase)) { context.Request.Path = "/index.html"; await next(); } });

// ==============

        app.UseStaticFiles();

        app.UseRouting();

        app.UseAuthentication();

        app.UseAbpRequestLocalization();

Hi,

I followed your suggestion making changes to the start.cs. But it always shows the swagger index.html. I then manually enter

localhost\index.html, i can get the login screen, then i got a bad request when i tried to login. It failed on /api/TokenAuth/Authenticate

Please advise thanks Laurie

Yes, tried it. It works

Showing 11 to 20 of 44 entries