New answers tagged

1

In EF there is built-in technique called table splitting; excerpt from the docs (emphasis mine): EF Core allows to map two or more entities to a single row. This is called table splitting or table sharing. Configuration To use table splitting the entity types need to be mapped to the same table, have the primary keys mapped to the same columns and at least ...


1

Depending on your needs, you could use an anonymous type or a defined type. var myData = context .MyEntities .Select(x => new { Key = x.Key, ImportantField1 = x.ImportantField1, ImportantField2 = x.ImportantField2 ...


1

I'm going to assume you are using a single SQL database to contain the data. "Update users set score = score + 10 where userid = @userid" This is reasonably fast, row level locking. But you just have a score, you lose the tie back to the vote. "Insert into votes...." "select sum(votes) where userid=@userid" Inserting is fast ...


Top 50 recent answers are included