Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

issues with Dbcontext.dbset.AddAsync in EF core 3.1

$
0
0

Hi,

I am trying to add a record using DBContext.DBset.AddAsync. This is how my code is:

await _dbContext.myDbSet.AddAsync(myentity);

int result = _dbContext.SaveChanges();

Please note that the datatypes in DBSet, database table and entity passed are in sync.

But the control is getting lost at _dbContext.SaveChanges() and the data is not getting saved in database. Am I doing something wrong?

I am using EF core 3.1.2.

Any help would be appreciated.

Best Regards,

Simpy Sinha


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>