-
Notifications
You must be signed in to change notification settings - Fork 215
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
Incorrect translation for function ContainsOrEqual in 5.0.0 #1609
Comments
Library Zack.EFCore.Batch breaks query translation. |
@heggi I couldn't reproduce the problem with the code below. Did you mean that Zack.EFCore.Batch is the source of the issue? If so, this should be flagged with the author of that library. Attempted reproawait using var ctx = new BlogContext();
await ctx.Database.EnsureDeletedAsync();
await ctx.Database.EnsureCreatedAsync();
var ipv4 = IPAddress.Parse("10.0.0.1");
_ = ctx.User
// .Where(m => m.Region == region)
.Where(m => EF.Functions.ContainsOrEqual(m.IPv4.Value, ipv4))
// .OrderBy(m => m.Mac)
.FirstOrDefault();
public class BlogContext : DbContext
{
public DbSet<User> User { get; set; }
static ILoggerFactory ContextLoggerFactory
=> LoggerFactory.Create(b => b.AddConsole().AddFilter("", LogLevel.Information));
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder
.UseNpgsql(@"Host=localhost;Username=test;Password=test")
.EnableSensitiveDataLogging()
.UseLoggerFactory(ContextLoggerFactory);
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
}
[Table("user")]
public class User
{
[Key, Column("uid")]
public string Uid { get; set; }
[Column("ip")]
public (IPAddress, int)? IPv4 { get; set; }
} |
If you add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code
Translated to
Got
u.ip@__ipv4_2
instead(u.ip >>= @__ipv4_2)
I could not find any error in my code :(
The text was updated successfully, but these errors were encountered: