Scaffold-DbContext (EF Core Tools) throws ‘Instance failure’ exception

I think you need to change your instance name. For example : Scaffold-DbContext “Server=PC\SQLEXPRESS;Database=***;User ID=sa;Password=****” Microsoft.EntityFrameworkCore.SqlServer -OutputDir model So your instance in this case is : PC\\SQLEXPRESS. This instance should be like this : .\SQLEXPRESS

Entity Framework Core: Database operation expected to affect 1 row(s) but actually affected 0 row(s) [duplicate]

There were two errors. First, I tried to call the Update() method without specifying a DbSet: _applicationDbContext.Update(user); Correct way: _applicationDbContext.Users.Update(user); The second error was trying to update a model that without first pulling it from the database: public bool UpdateUser(IdentityUser model) { _applicationDbContext.Users.Update(model); _applicationDbContext.SaveChanges(); return true; } Nope. I first needed to retrieve it from … Read more