We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I created this classes
[Table("Left")] public class Left { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public int Id { get; set; } [DisallowNull] public virtual Child Child { get; set; } = null!; public virtual Left? Next { get; set; } public virtual IList<Right> Rights { get; set; } = new List<Right>(); } [Table("Child")] public class Child { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public int Id { get; set; } } [Table("Right")] public class Right { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public int Id { get; set; } public virtual IList<Left> Lefts { get; set; } = new List<Left>(); }
And have this problem
var left1 = new Left(); left1.EnsureValidNullability();
This throw the error
If I get from the database I get no error
var optionsBuilder = new DbContextOptionsBuilder<ModelContext>().UseLazyLoadingProxies() .UseSqlServer("Server=.\\sql2019;Database=Nullable;Trusted_Connection=false;user id=sa;pwd=sa;MultipleActiveResultSets=true;Encrypt=false"); using (var context = new ModelContext(optionsBuilder.Options)) { var left = context.Left.Find(leftid); if (left != null) { var x = left.Child; left.GetType()?.GetProperty("Child")?.SetValue(left, null); x = left.Child; left.EnsureValidNullability(); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I created this classes
And have this problem
This throw the error
If I get from the database I get no error
The text was updated successfully, but these errors were encountered: