I am fairly new to ASP.NET, and I am trying to develop an application with I guess the database first. I most say the database isn't completed, and I use Microsoft SQL Server to maintain and develop the database. Since it is a new project I am developing my application using MVC 5, and I am able to see the table in Server Exploration, I did this by TOOLS->Connect to database. I am unsure on how to create the models.
Lets say I have a table call HOUSE with the following property
HOUSE
-----
ID int
Name nvchar
CreatedOn datetime
UpdatedOn datetime
I am not to sure how to create the model and the controller. Would I create my model as follow
public class House
{
public int ID { get; set; }
public string Name { get; set; }
public Datetime CreatedOn { get; set; }
public DateTime UpdatedOn { get; set; }
}
Do I need to setup a context or so?
I have followed this tutorial here to allow me to create the connection between Visual Studio and SQL Server, what the next step allow me to create the model.