From the course: Building and Securing Restful APIs in .NET

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Creating the database entities

Creating the database entities

- [Instructor] Now we've got a framework for our project, let's go start working on our database where we're going to store these different entities. So I'm going to select something under the Project folder here and add a new folder, call it Models. And I'll click add a new file and call that Employee.cs. And we can come in here and now we can add a namespace for this. So see it's going to helpfully give me the root namespace. We're going to do Models. So we've got a top level namespace now and we can do class. Alright, arrow down here and tab twice. It's going to give me my Employee class. I'm going to make sure that's public. And we're just going to add some properties here. So I want an Id. That's going to be my identifier for this. I'm going to use an int 'cause we're not going to have a ton of employees. And then we'll have a string Name. And I'm just hitting the space so when I hit tab it works. So this prop is just part of that IntelliSense we get. So if I type prop and hit…

Contents