abp icon indicating copy to clipboard operation
abp copied to clipboard

Entity Extensions (EF Core) in OrganizationUnit Entity cant delete in ver8.x

Open Vktun opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

hi when i use entity extension in 'AbpOrganizationUnit' extension columns like 'DisplayCode' image

OrganizationUnitManager.CreateAsync(OK) OrganizationUnitManager.UpdateAsync(OK) OrganizationUnitManager.DeleteAsync(failed) All the OrganizationUnit data has values image

the error like image

when i used ver8.x it will be occur

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

abp new -t module

Known Workarounds

No response

Version

8.x

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

Separate Auth Server

Operation System

Windows (Default)

Other information

No response

Vktun avatar Jul 24 '24 09:07 Vktun

Please try to EnableSensitiveDataLogging to see the SQL variable values.

maliming avatar Jul 24 '24 09:07 maliming

thank you for response ! in my opinion, when I just use default OrganizationUnitManager do soft delete , update command should not have extension properties. image

Vktun avatar Jul 24 '24 10:07 Vktun

Can you try your code in a new template project(SQL server)?

maliming avatar Jul 24 '24 23:07 maliming

I used new template ver8.2.0 to for same mysql db ,I worked ,but I cant find other different libs. new template generate sql is ideal. but my project is from v7.x to ver 8.x . I figure it ,this problem is the layers domain ,domain.shared ,application.contracts TargetFrameworks use netstandard2.1;.net8.0 will be occur ,if I change to net8.0 only will be right, solve this problem. image

Vktun avatar Jul 25 '24 01:07 Vktun

,if I change to net8.0 only will be right, solve this problem.

This sounds like a Database provider problem.

maliming avatar Jul 26 '24 02:07 maliming

Hi, do you know if this issue is still open?

Pantex9 avatar Aug 26 '24 23:08 Pantex9

I may encounter the same issue when using the latest version (8.3.0-rc.3). In my example code, there are two extended properties: DbProperty is mapped to a database field through EFCore and cannot be NULL, while NoDbProperty is stored in ExtraProperties. When I delete an entity, the generated SQL sets DbProperty to NULL.

iShot_2024-09-02_10 58 25 iShot_2024-09-02_11 00 52

Sample Code

cdlian avatar Sep 02 '24 03:09 cdlian