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.
2 Answer(s)
-
0
- This is a known limitation in ABP Suite (at least for Blazor UI solutions generated with Blazorise):
Guidis not offered as a primitive property type in the Suite entity designer becauseGuidis 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
- 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; } }- Create and apply an EF Core migration after adding the properties (standard EF Core workflow).
- If you still want Suite to generate the UI and DTO parts, you can keep using Suite for the rest, and maintain these
Guidfields 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
Guidin 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) - This is a known limitation in ABP Suite (at least for Blazor UI solutions generated with Blazorise):
-
0
Hi,
This isn't an accidental omission, but it only happens on Blazor UI solutions. On Blazor WebAssembly and Blazor Server, Suite hides
Guid(andchar) 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
Guidfield, so Suite leaves it out of the dropdown to avoid generating a form with a field you can't edit.For your case — a
Guidthat'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(theBookBaseclass, fully regenerated every time) andBook.Extended.cs(theBookclass where your own code lives). If you don't see the.Extended.csfile, 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 updateWith SQL Server these map to plain
uniqueidentifiercolumns. They won't become navigation properties or foreign keys unless you add a relationship yourself.We'll look at adding first-class
Guidsupport 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)