Base solution for your next web application
Open Closed

RAD Tool #4866


User avatar
0
gbadenhorst created

Hi,

I have no problem changing this on my side as you guys are already giving us so much and it is a wonderful project:

I don't know if this is also something that other people might find useful as a default for the RAD tool.

Due nature of the system that I am currently writing which is a full ERP/CRM/E-Commerce/Projects/ Production system I have a lot of links on certain tables which are always on other tables by default.

Currently, when you are generating the links between tables there is by default a property Id specified which can be changed naturally. At first, I did not notice the naming convention directly relates to the property and does not have an alternative "link" value of sort.

I encountered errors due to this hence why I am suggesting this, although it is not a train smash or anything, it is a nice to have and possibly something other people might like/agree on.

In the previous project when we linked tables we always referred to the naming convention as FK_TableName_LinkTableName_LinkeProperty.

Currently, WarehouseId is referenced in all tables where Warehouse is specified which create duplicates in the end.

In my case, it would be something like: FK_Products_ProductWarehouse_WarehouseId.

I don't know if there is a suggestion thread somewhere for things like this but here it is. If there is a place for suggestion please let me know where and ill remove the post here and drop it where required and future things as well.


4 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Currently, WarehouseId is referenced in all tables where Warehouse is specified which create duplicates in the end.

    I didn't get this. What duplicates? Can you show code?

    I don't know if there is a suggestion thread somewhere for things like this but here it is.

    It's not clear, what's the suggestion here?

  • User Avatar
    0
    gbadenhorst created

    Hi,

    Sorry I might be interpreting this wrong but the Lookup Table DTO's are causing the conflicts:

    The below only happens once you link an object more than once.

    System.InvalidOperationException: Conflicting schemaIds: Identical schemaIds detected for types Abp.Application.Services.Dto.PagedResultDto1[[BMS.Products.Dtos.ProductDepartmentLookupTableDto, BMS.Application.Shared, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]] and Abp.Application.Services.Dto.PagedResultDto1[BMS.DiscountGroups.Dtos.ProductDepartmentLookupTableDto]. See config settings - "CustomSchemaIds" for a workaround at Swashbuckle.AspNetCore.SwaggerGen.SchemaIdManager.IdFor(Type type) at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.CreateReferenceSchema(Type type, Queue1 referencedTypes) at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.GetOrRegister(Type type) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateResponse(ApiResponseType apiResponseType, ISchemaRegistry schemaRegistry) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable1 apiDescriptions, ISchemaRegistry schemaRegistry) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath, String[] schemes)

  • User Avatar
    0
    yekalkan created

    Hi @GBadenhorst,

    We are aware of that Swagger issue. Deleting of one of the classes that has same schema is the easiest solution for now.

    see also <a class="postlink" href="https://stackoverflow.com/questions/46071513/swagger-error-conflicting-schemaids-duplicate-schemaids-detected-for-types-a-a">https://stackoverflow.com/questions/460 ... -types-a-a</a>

  • User Avatar
    0
    gbadenhorst created

    Hi @yekalkan

    Thank you, was a misunderstanding on my side (Lack of knowledge relating to swagger).

    I ended up moving Lookup/Link DTOs which are used more than once to a shared folder and just removing the newly created ones as suggested.

    Love the RAD tool. The linked entities how it is implemented now with the RAD tool is saving me sooooo much time.