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

Exception creating new entity with two properties mapped to one column #25062

Closed
SiestaGuru opened this issue Jun 9, 2021 · 2 comments
Closed

Comments

@SiestaGuru
Copy link

I want to point two properties at a single column like this to be able to both access my field as an enum and with the raw underlying string value:

tc.Property(x => x.RawStatus)
		.HasColumnName("STATUS");
tc.Property(x => x.StatusEnum)
	  .HasColumnName("STATUS")
	  .HasConversion<String>(
		a => FromEnum(a),
		b => ToEnum(b));

This appears to be supported by EF Core since it accepts this configuration and seems to work acceptably for existing entity.

But, if I then create a new entity with this configuration and call db.SaveChanges() I receive the following error:

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Devart.Data.Oracle.OracleException: ORA-06550: line 4, column 188:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 4, column 1:
    PL/SQL: SQL Statement ignored

Is this not fully supported after all? Am I missing something? Or is it a EF Core or Devart bug?

I'm using EF Core v5.0.7 and devart v9.14.1273 on a Oracle database

@AndriySvyryd
Copy link
Member

I couldn't repro this with SQL Server, so I think it's an issue in the Devart provider.

@SiestaGuru
Copy link
Author

I've submitted it as a bugreport to Devart, but they believe it's also an issue using SQL Server. See this thread with example code:
https://forums.devart.com/viewtopic.php?f=30&t=46864&sid=904326cf9c592c0ecb76d491c065416f

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants