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 - .NET Tutorial
From the course: Building and Securing Restful APIs in .NET
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
REST level set4m 47s
-
(Locked)
Creating the API project7m 13s
-
(Locked)
Creating the database entities7m 14s
-
(Locked)
Creating and seeding the database3m 50s
-
(Locked)
Defining the resources4m 58s
-
(Locked)
Mapping resources and entities3m 52s
-
(Locked)
Setting up the resource controller3m 2s
-
(Locked)
Set up the HTTP test file7m 15s
-
-
-
-
-
-