Delete on Cascade

I have this problem: version 2.50.13
I disabled "Enable cascade delete"
I have two linked tables Customer and CustomeRole
Customer has a field linked to CustormerRole
If I start the application and try to delete a CustomerRole already present in Customer I get an error message.
However, if I added another Customer connected to CustomerRole and then I want to delete the CustomerRole this happens in cascade.

Your database have constraints disallowing deletes of related entities.

Database:

CREATE TABLE [dbo].[CustomerRole](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] nvarchar NOT NULL,

CONSTRAINT [PK_CustomerRole] PRIMARY KEY CLUSTERED
(
[Id] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],

CONSTRAINT [SK_CustomerRole] UNIQUE NONCLUSTERED
(
[Name] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

CREATE TABLE [dbo].[Customer](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] nvarchar NOT NULL,
[CustomerRoleId] [int] NOT NULL,

CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
[Id] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],

CONSTRAINT [SK_Customer] UNIQUE NONCLUSTERED
(
[Name] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Customer] WITH CHECK ADD CONSTRAINT [FK_Customer_CustomerRole_Id] FOREIGN KEY([CustomerRoleId]) REFERENCES [dbo].[CustomerRole] ([Id])
GO

And generated:

Cascade delete depends on your foreign keys. If your relations are optional (nullable foreign key) and you delete parent entity all child entities foreign keys will be set to null. If your relations are required loaded in memory child entities will be deleted. More info can be found here:
https://docs.microsoft.com/en-us/ef/core/saving/cascade-delete

The only thing that Radzen is doing when Cascade Delete is enabled is to add Include(i => i.ChildEntity) when finding the item for deletion. Check the delete method of the service.

I inserted the entry ".OnDelete(DeleteBehavior.ClientNoAction)"
in ...data .... OnModelCreating

builder.Entity<Sample.Models.Sample.Customer>()
.HasOne(i => i.CustomerRole)
.WithMany(i => i.Customers)
.HasForeignKey(i => i.CustomerRoleId)
.OnDelete(DeleteBehavior.ClientNoAction)
.HasPrincipalKey(i => i.Id);

and Now it works.
Thanks

Yes, it's the same code when cascade delete is enabled.