You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Shipment
{
public int Id { get; set; }
public string CarrierName { get; set; }
public int? CargoReportId { get; set; }
public Report CargoReport { get; set; }
public int? AltCargoReportId { get; set; }
public Report AltCargoReport { get; set; }
}
public class Report
{
public int Id { get; set; }
public string Reference { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Shipment> Shipments { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=.;Database=Repro5613;Trusted_Connection=True;MultipleActiveResultSets=true;");
}
}
query:
var query = ctx.Shipments
.Where(s => s.CargoReport.Reference.Contains("whatever")
|| s.AltCargoReport.Reference.Contains("whatever"));