Starts in:
0 DAY
6 HRS
7 MIN
4 SEC
Starts in:
0 D
6 H
7 M
4 S
Open Closed

problem with navigation properties in abp suite #1289


User avatar
0
misafer created
  • ABP Framework version: v4.3.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:Error occurred on DB migration step! Make sure the project is compiled and working. Command output: Build started... Build failed. Use dotnet build to see the errors.
  • Steps to reproduce the issue:
    • create s simple project using abp suite
    • in simple case just make two entities like Country and Province that relates 1 to many
    • first save and generate country , everything is ok here
    • at the end save and generate province that have just a name property and a navigation property to country
    • the errors are appeared


6 Answer(s)
  • User Avatar
    0
    misafer created

    Country.json :

    { "Id": "64402358-9115-4f83-9726-6d26ea3132c3", "Name": "Country", "OriginalName": "Country", "NamePlural": "Countries", "DatabaseTableName": "Countries", "Namespace": "Countries", "BaseClass": "FullAuditedAggregateRoot", "PrimaryKeyType": "int", "IsMultiTenant": false, "ShouldCreateUserInterface": true, "ShouldCreateBackend": true, "ShouldAddMigration": true, "ShouldUpdateDatabase": true, "CreateTests": true, "Properties": [ { "Id": "065ce185-6c51-4499-8881-701ac22d1878", "Name": "CountryName", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "IsNullable": false, "IsRequired": true, "MinLength": 3, "MaxLength": 100, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "EnumValues": null } ], "NavigationProperties": [], "PhysicalFileName": "Country.json" }

    Province.Json:

    { "Id": "6361bc83-6206-4a26-b06a-f49e17c5a98a", "Name": "Province", "OriginalName": "Province", "NamePlural": "Provinces", "DatabaseTableName": "Provinces", "Namespace": "Provinces", "BaseClass": "FullAuditedAggregateRoot", "PrimaryKeyType": "int", "IsMultiTenant": false, "ShouldCreateUserInterface": true, "ShouldCreateBackend": true, "ShouldAddMigration": true, "ShouldUpdateDatabase": true, "CreateTests": true, "Properties": [ { "Id": "7b2fb170-d133-4bb1-8d4b-6c042739d524", "Name": "ProvinceName", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "IsNullable": false, "IsRequired": true, "MinLength": 3, "MaxLength": 100, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "EnumValues": null } ], "NavigationProperties": [ { "Namespace": "MVC1.Countries", "EntityName": "Country", "EntityNameWithDuplicationNumber": "Country", "EntitySetNameWithDuplicationNumber": "Countries", "EntitySetName": "Countries", "DtoNamespace": "MVC1.Countries", "DtoEntityName": "CountryDto", "Type": "int", "Name": "CountryId", "ReferencePropertyName": "Country", "DisplayProperty": "CountryName", "UiPickType": "Dropdown", "IsRequired": true } ], "PhysicalFileName": "Province.json" }

  • User Avatar
    0
    alper created
    Support Team Director

    I created a new project with the latest version and I couldn't reproduce it. if you copy paste the json file from another project, it will not compile because there's a namespace of other project.

  • User Avatar
    1
    misafer created

    Dear Alper ok, you're right. but if i check the Required checkbox of the navigation property. thats the problem. please check it again. also by regenerating the entity, the menu property fields are duplicated by generator. thansk a lot

  • User Avatar
    0
    alper created
    Support Team Director

    ok. I'll check it again

  • User Avatar
    0
    alper created
    Support Team Director

    In the latest version 4.3.2 I tested with MVC project. and it's working.

  • User Avatar
    0
    alper created
    Support Team Director

    I have reproduced the issue and will be fixed in v4.4 preview rc2

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06