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

IEntityTypeBuilder<TEntity>.Entity<TEntity> automatically creates FieldMetadata for primitive field in Base class #102

Closed
mrt181 opened this issue Nov 22, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mrt181
Copy link

mrt181 commented Nov 22, 2024

Describe the bug
I am using the modelbuilder to flag a field as a pseudo column that is defined as a primitive type on a the base class.

When that field is not nullable the builder contains a default definition for that field when the builder is instantiated.

When that field is nullable the builder does not contain a default definition for that field when the builder is instantiated.
To Reproduce

public class Row
{
  public long? RowOffset { get; set; }
  public short? RowPartition { get; set; }
  public long RowTime { get; set; }
}

public class MyValue : Row
{
  public int Id { get; set; }
}

var builder = new ModelBuilder();
builder.Entity<MyValue>().Property(p => p.RowTime).AsPseudoColumn();

Expected behavior
I expect the fieldMetadata for RowTime to be in the builder with the correct settings.

Screenshots
This is when the Entity is created
image
It already contains the RowTime field.

This is after adding the RowTime and flagging it as a pseudo-column.
image
The field is defined twice now.

Environment (please complete the following information):

  • ksqlDb version: 7.7.1
  • ksqlDb.RestApi.Client Nuget package version 6.5.0
  • TFM [net8.0]

Additional context
Add any other context about the problem here.

@tomasfabian tomasfabian added the bug Something isn't working label Nov 22, 2024
tomasfabian added a commit that referenced this issue Nov 23, 2024
tomasfabian added a commit that referenced this issue Nov 23, 2024
tomasfabian added a commit that referenced this issue Nov 23, 2024
@tomasfabian tomasfabian self-assigned this Nov 23, 2024
@tomasfabian
Copy link
Owner

Hello Martin, I prepared a hot fix #103.

@tomasfabian
Copy link
Owner

Hello @mrt181, could you please review the related PR and let me know if it is safe to release the changes? Thanks!

@tomasfabian
Copy link
Owner

I released a hotfix:

NuGet\Install-Package ksqlDb.RestApi.Client -Version 6.5.1

@mrt181
Copy link
Author

mrt181 commented Dec 4, 2024

The hotfix works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants