I’m very much begginer to ASP.net and Just followed a tutorial and created a small web app.I understood the basics up to creating a Model in Visual Studio Mac Edition (2022) , However , when I tried to use entity frame work to Link controller and create a view with user interface ,I get null value for "DB context Class to Use" field. I don’t know how to fix this issue since I’m using Mac edition of Visual Studio. DB connect Class to Use is Null
Following is my code in the Model class
using System;
using System.Linq;
using System.Data;
namespace WiseTaskMgtSystem.Models
{
public class UserModel
{
public int ID { get; set; }
public String UserName { get; set; }
public String password { get; set; }
public UserModel()
{
}
}
}
I would be highly appreciated if someone could assist me on this to solve the issue.
Thank you.!
2
Answers
did you add DBcontextin your solution ? take Image from solution explorer
DbContext is base class for managing database connections and provides functionality for CRUD operations, that is Database related functionality like data access methods to interact with Database.
In Example below
UserProfile
is Table in the Database.