S
S
SG15542019-09-09 16:34:03
C++ / C#
SG1554, 2019-09-09 16:34:03

How to check if a database contains a certain element in Entity Framework?

How to check the database for the presence of certain elements because the same elements cannot be added to the database in the Entity Framework.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
benjik, 2019-09-19
@SG1554

Through the DbSet's .AddOrUpdate() method.
Here is an example of usage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question