SqlException: Invalid object name "User"

Hi im getting this error where it says "SqlException: Invalid object name ‘User’. even though i have build the application without errors and checked the application everything except this works, please do give me some suggetsions.


 public async Task<User> Create(User user)
            await _context.SaveChangesAsync();//error happens here
            return user;

>Solution :

Change _context.User.Add(user); to _context.Users.Add(user);

Leave a Reply