Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample can not delete Objects, NetCore6.0, SqlServer #2

Open
lehoangphan opened this issue Nov 10, 2024 · 0 comments
Open

Sample can not delete Objects, NetCore6.0, SqlServer #2

lehoangphan opened this issue Nov 10, 2024 · 0 comments

Comments

@lehoangphan
Copy link

lehoangphan commented Nov 10, 2024

I clone this repository, and downgrade to version netcore6.0, sql server.

<Project Sdk="Microsoft.NET.Sdk.Web">

	<PropertyGroup>
		<TargetFramework>net6.0</TargetFramework>
		<Nullable>enable</Nullable>
		<ImplicitUsings>enable</ImplicitUsings>
	</PropertyGroup>

	<ItemGroup>
		<None Include="wwwroot\css\.DS_Store" />
		<None Include="wwwroot\fonts\.DS_Store" />
		<None Include="wwwroot\images\.DS_Store" />
		<None Include="wwwroot\js\.DS_Store" />
		<None Include="wwwroot\js\extensions\.DS_Store" />
		<None Include="wwwroot\js\site.js" />
		<None Include="wwwroot\scss\.DS_Store" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Platformus.Core.Data.EntityFramework.SqlServer" Version="3.0.4" />
		<PackageReference Include="Platformus.Images" Version="3.0.4" />
		<PackageReference Include="Platformus.WebApplication" Version="3.0.4" />
		<PackageReference Include="Platformus.Website.Backend" Version="3.0.4" />
		<PackageReference Include="Platformus.Website.Data.EntityFramework.SqlServer" Version="3.0.4" />
		<PackageReference Include="Platformus.Website.Frontend" Version="3.0.4" />
	</ItemGroup>

</Project>

When I delete sample data (Object), it throw exception:

An unhandled exception occurred while processing the request.
SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_Properties_Objects". The conflict occurred in database "MyDB", table "dbo.Properties", column 'ObjectId'.
The statement has been terminated.
Microsoft.Data.SqlClient.SqlCommand+<>c.<ExecuteDbDataReaderAsync>b__188_0(Task<SqlDataReader> result)

DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant