entity-framework-6

Entity Framework 6 DbSet AddRange vs IDbSet Add - How Can AddRange be so much faster?

我是研究僧i 提交于 2020-03-18 11:27:39
问题 I was playing around with Entity Framework 6 on my home computer and decided to try out inserting a fairly large amount of rows, around 430k. My first try looked like this, yes I know it can be better but it was for research anyway: var watch = System.Diagnostics.Stopwatch.StartNew(); foreach

Entity Framework 6 DbSet AddRange vs IDbSet Add - How Can AddRange be so much faster?

北城以北 提交于 2020-03-18 11:27:12
问题 I was playing around with Entity Framework 6 on my home computer and decided to try out inserting a fairly large amount of rows, around 430k. My first try looked like this, yes I know it can be better but it was for research anyway: var watch = System.Diagnostics.Stopwatch.StartNew(); foreach

Entity Framework 6 - inheritance and navigation properties on base class

风流意气都作罢 提交于 2020-02-21 06:30:15
问题 I have a problem with navigation properties and inheritance. This is my problem: I have a base Person class and classes User and Worker which inherit from Person . On the DB level I'm using single table inheritance or table per hierarchy (TPH) inheritance. So there a single table with a

Code-first migration: How to set default value for new property?

妖精的绣舞 提交于 2020-02-12 17:35:26
问题 I am using EF6 for storing instances of the report class in my database. The database already contains data. Say I wanted to add a property to report , public class report { // ... some previous properties // ... new property: public string newProperty{ get; set; } } Now if I go to the package