Tvde1
Not mapping an EF Core DB-First enum property
I have scaffolded my Db Context. My entity has a
I am making a partial class which is:
Yet, when I do
_context.Hosts.ToList()
, it does attempt to select a column named "Status". How do I prevent this? The NotMapped
attribute does not seem to be working.23 replies
❔ ✅ Could not load file or assembly Microsoft.Bcl.AsyncInterfaces 7.0.0.0
I've upgaded the packages of about 100 csproj in multiple solutions and now each service logs:
When the /health endpoint is called.
I can't tell which NuGet package is causing this.
What's the recommended approach?
3 replies
Update SQL database rows with a dictionary [Answered]
I have the following SQL server table:
Where the URL column is empty for all rows.
I have an excel sheet with an id and a url:
How can I create an UPDATE / MERGE statement where it will put all the correct URLs in my table?
I know you can do an INSERT like
But I can't find whether you can do this with an UPDATE statement.
You can do
But how do I get my data in that query?
10 replies
Query over multiple entities using the same interface [Answered]
I have a EF setup, where ~20 entities implement
IArchivable
This interface has a public
I wish to perform a query to find the entity with a certain id, and then another query to set the IsArchived
property to false
.
Is this possible with EF? (something like _context.Set<IArchivable>().Where(...)
Or should I loop through all types (using reflection) and build an IQueryable for each of them?13 replies