Open Closed

ABP Suite does not allow creating Guid properties for entities #10770


User avatar
0
AlessandroLittera created

Hi ABP Team,

I noticed that ABP Suite currently does not allow creating a property of type Guid.

When defining a new property for an entity, the available primitive types include:

string bool int long decimal double DateTime DateOnly TimeOnly etc.

However, Guid is missing from the list.

This makes it impossible to create a simple Guid property that is not a navigation property.

Steps to reproduce Open ABP Suite. Create or edit an entity. Go to Properties. Click Add Property. Open the Property Type dropdown. Expected behavior

Guid (and optionally Guid? through Nullable) should be available as one of the primitive property types.

Example:

public Guid ExternalId { get; set; }

public Guid? LinkedEntityId { get; set; }

without creating a navigation property or foreign key.

Actual behavior

Guid is not available in the property type list, so the only way to reference another identifier is by creating a Navigation Property, which also generates EF Core relationships and foreign keys.

There are valid scenarios where a Guid is simply an application identifier and not an EF relationship.

Is this an intentional limitation, or could Guid be added as a supported primitive property type in ABP Suite?

In our project we use Guid values to reference external resources or logical associations that are not database foreign keys. Having Guid available as a primitive type would avoid creating unnecessary navigation properties and EF Core relationships.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This is a known limitation in ABP Suite (at least for Blazor UI solutions generated with Blazorise): Guid is not offered as a primitive property type in the Suite entity designer because Guid is not supported for binding in Blazorise components, so Suite doesn’t support generating it from the UI right now.
    • So, in that context, it’s intentional (current limitation) rather than an accidental omission.

    What you can do today

    1. Add the Guid property manually in code (Domain entity + EF Core mapping/migration), without creating a navigation property:
    public class MyEntity : AggregateRoot<Guid>
       {
           public Guid ExternalId { get; set; }
           public Guid? LinkedEntityId { get; set; }
       }
    
    1. Create and apply an EF Core migration after adding the properties (standard EF Core workflow).
    2. If you still want Suite to generate the UI and DTO parts, you can keep using Suite for the rest, and maintain these Guid fields manually.

    If your main goal is “a Guid field but not an FK”, the manual approach is the correct workaround until Suite adds first-class support for Guid in that property dropdown for your UI stack.

    Links (validated):

    • https://abp.io/support/questions/7860
    • https://docs.abp.io/en/commercial/latest/abp-suite/index
    • https://commercial.abp.io/tools/suite

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    This isn't an accidental omission, but it only happens on Blazor UI solutions. On Blazor WebAssembly and Blazor Server, Suite hides Guid (and char) from the property type dropdown. On MVC and Angular solutions both are available as normal primitive types.

    The reason is that the Blazor CRUD page generator currently has no input template for a standalone Guid field, so Suite leaves it out of the dropdown to avoid generating a form with a field you can't edit.

    For your case — a Guid that's just an application identifier and not an FK — you don't need Suite to scaffold an input for it anyway, so the cleanest approach is to add it in the entity's custom-code file, which Suite keeps when you regenerate.

    Make sure Customizable code is enabled for the entity. Suite then generates the entity as two files: Book.cs (the BookBase class, fully regenerated every time) and Book.Extended.cs (the Book class where your own code lives). If you don't see the .Extended.cs file, enable Customizable code and regenerate the entity first. Add the properties in the extended one:

    // Books/Book.Extended.cs
    public class Book : BookBase
    {
        //<suite-custom-code-autogenerated>
        // (constructors are managed by Suite here)
        //</suite-custom-code-autogenerated>
    
        // Your custom code below is preserved on regeneration
        public Guid ExternalId { get; set; }
        public Guid? LinkedEntityId { get; set; }
    }
    

    One thing to keep in mind: since these live in your custom code and not in the Suite entity model, Suite won't add them to the DTOs, the app service, or the CRUD UI. That's fine when the value is set/read by your own domain/application code, which matches your "logical association, not an FK" scenario.

    Then add a migration and update the database (run from your EF Core project, or add the migration there and apply it with the DbMigrator):

    dotnet ef migrations add Added_External_Guids
    dotnet ef database update
    

    With SQL Server these map to plain uniqueidentifier columns. They won't become navigation properties or foreign keys unless you add a relationship yourself.

    We'll look at adding first-class Guid support to the Blazor generator in a future Suite version so you can pick it directly from the dropdown.

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 21, 2026, 06:18
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.