ageiter的活动

Let's say, for example, you have an entity that you need to add two 1 to 1 relationships with the same external Entity.

For example, for the entity "Exchange" you need to map two "Money" entities as 1 on 1

Actually, in ABP Suite, there is no way to customize the property name of the navigation classes for Domain or Application.Contracts. Even if you try to customize the "Entity Name" or "Dto Name" in the advanced tap, if you change, for example, "Entity Name", your class will be named "BlueMoney" and the property name also as "BlueMoney" but the correct should be, class "Money" and property name "BlueMoney".

That's for the case when you need to repeat the 1-1 relationship with the same entity.

Related to this, I would also like to repeat my wish that you can create several navigation properties for the same entity with a self-defined name. No matter whether 1:1 or 1:n. Currently you can define the property name (Id property) yourself, but the navigation properties are then numbered with the default name.

  • ABP Framework version: v8.2.0-rc.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Exception message and full stack trace:

2024-06-07 15:45:54.755 +02:00 [INF] Request starting HTTP/1.1 GET http://localhost:3000/api/abpSuite/solutions/7384c0a3-fafd-490e-ab37-0f5fea69a2f1/is-built - application/json null 2024-06-07 15:45:54.755 +02:00 [INF] Executing endpoint 'Volo.Abp.Suite.Controllers.AbpSuiteController.IsSolutionBuiltAsync (Volo.Abp.Suite)' 2024-06-07 15:45:54.755 +02:00 [INF] Route matched with {action = "IsSolutionBuilt", controller = "AbpSuite", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Boolean] IsSolutionBuiltAsync(System.Guid) on controller Volo.Abp.Suite.Controllers.AbpSuiteController (Volo.Abp.Suite). 2024-06-07 15:45:54.764 +02:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Cannot find the directory ", "details": null, "data": {}, "validationErrors": null }

2024-06-07 15:45:54.764 +02:00 [WRN] Cannot find the directory Volo.Abp.UserFriendlyException: Cannot find the directory at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SuiteAssemblyService.uPn9nvS1gR(String ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SuiteAssemblyService.Kdx9mQx5O4(Solution , String& ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SuiteAssemblyService.Ptv9vW5XHQ(Solution , String& ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SuiteAssemblyService.AssemblyExists(Solution solution) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SolutionService.IsSolutionBuiltAsync(Guid solutionId) at Volo.Abp.Suite.Controllers.AbpSuiteController.IsSolutionBuiltAsync(Guid solutionId) at lambda_method2005(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

I wanted to change the path of my solution and moved it to another directory. I then removed the solution in the ABP Suite and added it again. When opening the entities or templates, the error message appears:

The error seems to occur in the IsSolutionBuiltAsync method. The same error occurs when calling it directly: http://localhost:3000/api/abpSuite/solutions/7384c0a3-fafd-490e-ab37-0f5fea69a2f1/is-built {"error":{"code":null,"message":"Cannot find the directory ","details":null,"data":{},"validationErrors":null}}

What I have already done / checked:

  • Restarting the computer
  • Reload the solution in the suite
  • Rebuild the solution
  • Repository recloned
  • Check the .abp\suite\appsettings.json: all paths are correct
  • Even if I copy the solution back into the old directory, it no longer works :-(

Since the code is not public, I unfortunately cannot find out what it wants to access... Good to know: It finds and displays the entity definition files.

I hope you can help me soon.

In version 8.1, the following structure was generated by the Suite for the EntityFramework (for a Blazor Server project):

And now in 8.2.0-rc.3 it looks like this (for a Blazor Web App project):

Basically, I find it much clearer now. But I would like to add additions to the model, which I previously did in the “...DbContextBase” class. If I now do this in the “...DbContext” class, it will be deleted again the next time I generate it. How could I do this so that it remains there regardless of generation?

I would like to add the following for the decimal properties:

protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);
    
    builder.Entity<Disability>(b =>
    {
        b.Property(x => x.DegreeOfDisability).HasPrecision(18, 4);
    });
}

Using ABP 8.2.0-rc.3

I have generated the following entities with Blazor UI:

  • "Incident" as master
  • "Disability" as child of "Incident"

In the child entity there is a decimal property with min & max values.

In the generated Razor page these are expected in the constant class of the master entity.

I think the error can be found in this template:

Possibility for inheritance of entities.

https://learn.microsoft.com/en-us/ef/core/modeling/inheritance

https://community.abp.io/posts/inheritance-strategies-in-entity-framework-core-7-hg82tp4h?utm_source=twitter&utm_medium=announcement

I understand the problem... In my case, it's mainly about the modal control, which doesn't work. If at least that would work, I would be happy. I could live with the rest of the error messages. But without the modal control, of course the whole admin area doesn't work.

I think the Blazorise controls are the main problem. Can you address the need there as well?

There is already an issue there: https://github.com/Megabit/Blazorise/issues/5460

But which part of the code contains inline CSS? The one from ABP? The one from Blazorise? Because I have fixed everything in my code.

Have you been able to reproduce it with the ABP Suite template? What alternatives do I have if the customer insists on a secure CSP?

Sure... but it's the same as in the code above ;-)

  1. Generate Blazor Server project with ABP Suite template (I have version 8.0.4)
  2. Add the following method in the BlazorModule:
private void ConfigureSecurityHeaders()
{
    Configure<AbpSecurityHeadersOptions>(options =>
    {
        options.UseContentSecurityPolicyHeader = true;
        options.ContentSecurityPolicyValue = "base-uri 'self'; default-src 'none'; img-src 'self' data:; script-src 'self'; style-src 'self'; font-src 'self'; connect-src 'self'; frame-ancestors 'none'";
    });
}
  1. Call it under ConfigureServices:

  2. If necessary, the order in OnApplicationInitialization must be changed so that app.UseAbpSecurityHeaders() is called after app.UseRouting() (see https://github.com/abpframework/abp/issues/19653)

  3. Testing... Open the console in the browser and open a modal dialog, for example.

  • ABP Framework version: v8.0.4
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

We have to apply certain CSPs (Content Security Headers) for our customer. I have problems with the following policy:

style-src 'self'

For example, the column widths are no longer set correctly in the DataGrid and, more importantly, the modal components are no longer displayed.

The policy looks like this:

options.UseContentSecurityPolicyHeader = true; 
options.ContentSecurityPolicyValue = "base-uri 'self'; default-src 'none'; img-src 'self' data:; script-src 'self'; style-src 'self'; font-src 'self'; connect-src 'self'; frame-ancestors 'none'";

With style-src 'self' 'unsafe-inline' it would work... but is not allowed.

Need a solution as soon as possible... Thank you!

显示 184 个条目中的 1 到 10 个.
Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11