Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

code:

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading