Base solution for your next web application
Open Closed

Entity-Generator-to-Multilingual-Property-MCV-jquery #12434


User avatar
0
ncvitanovic created

I am trying to make an entity that has a dropdown navigation property connected to a multilingual entity, but it gives me errors in the generated app service: Name is a multilingual property of the Property entity.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

8 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ncvitanovic

    I think your version of Power Tools is not the latest version. After upgrading Power Tools to version 4.6.2, can you regenerate or try to recreate the entity you created? This problem is fixed in the latest version. Please don’t hesitate to reach out if the issue persists.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ncvitanovic created

    Hello. I have the latest 4.6.2 installed.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ncvitanovic

    Could you please share with us the entity json file that is created in the entity that has the problem, by hiding the important parts? This is to be able to reproduce the problem. Thank you.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ncvitanovic created

    { "IsRegenerate": false, "MenuPosition": "Accommodation", "RelativeNamespace": "Accommodation", "EntityName": "Property", "EntityNamePlural": "Properties", "TableName": "Properties", "PrimaryKeyType": "int", "BaseClass": "FullAuditedEntity", "EntityHistory": true, "AutoMigration": true, "UpdateDatabase": false, "CreateUserInterface": true, "CreateViewOnly": true, "CreateExcelExport": true, "CreateExcelImport": true, "IsNonModalCRUDPage": true, "IsMasterDetailPage": false, "GenerateOverridableEntity": false, "GenerateUnitTest": false, "GenerateUiTest": false, "GenerateMobile": false, "PagePermission": { "Host": false, "Tenant": true }, "Properties": [ { "Name": "Name", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": true, "Nullable": false, "Regex": "", "IsMultiLingual": true, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "Email", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": true, "Nullable": false, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "Url", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "UrlServer", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "Address", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "PostalCode", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "City", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "Country", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": true, "ListMaui": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "MapPath", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": false, "List": false, "ListMaui": false, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "MapSvgPath", "Type": "string", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": false, "List": false, "ListMaui": false, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "AvailabilityVisible", "Type": "Visible", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "IsMultiLingual": false, "UserInterface": { "AdvancedFilter": true, "List": false, "ListMaui": false, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} } ], "NavigationProperties": [], "NavigationPropertyOneToManyTables": [], "EnumDefinitions": [ { "Name": "Visible", "Namespace": "aRento.Server.Enums", "EnumProperties": [ { "Name": "Guest", "Value": 0 }, { "Name": "GuestVip", "Value": 1 }, { "Name": "User", "Value": 2 }, { "Name": "Owner", "Value": 3 } ] } ], "DbContext": null }

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ncvitanovic

    Thank you for your feedback. We have created an issue for this, and you can follow the progress from there. In the meantime, you can use the code snippet below as a temporary solution. Thank you.

     Id = property.Id,
     DisplayName = property.Translations?.Select(t => t.Name).FirstOrDefault()
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ncvitanovic created

    It does solve the issue, but it only gives the default language.

    It should be language-dependent. Am I right?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ncvitanovic

    Yes you are right, thank you for your feedback. You can update it as below. I will fix this. Thank you.

    Id = car.Id,
    DisplayName = car.Translations?
        .FirstOrDefault(t => t.Language == CultureInfo.CurrentUICulture.Name)?.Name
        ?? car.Translations?.FirstOrDefault()?.Name
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ncvitanovic created

    Thanks

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)