034 CREATING LOOKUP RESOURCE PROJECTS - chempkovsky/CS82ANGULAR GitHub Wiki
- Command Prompt
- Entity Framework project
- DbContext project
- Views or Dto project
- Controllers project
- WebApi project
- Remove Class1 files
- Remove WeatherForecastController
- Remove WeatherForecast
- Add PhBk folder
- Add Controllers folder
- Reminder
- read the article 033 to clarify for which purposes the lookup resource is being created
- read the article 004 about created solution and projects.
- the prefix for the names of the newly created projects will be
LpPhBkwhich meansLookUp for the Phonebook.
- run Command Prompt and make
E:\Development\PhonebookSolutionfolder active
C:\>e:
e:\>cd E:\Development\PhonebookSolution
E:\Development\PhonebookSolution>
dotnet new classlib -o LpPhBkEntity
dotnet sln PhonebookSolution.sln add LpPhBkEntity/LpPhBkEntity.csproj --solution-folder Server
dotnet add LpPhBkEntity/LpPhBkEntity.csproj package Microsoft.EntityFrameworkCore
dotnet new classlib -o LpPhBkContext
dotnet sln PhonebookSolution.sln add LpPhBkContext/LpPhBkContext.csproj --solution-folder Server
dotnet add LpPhBkContext/LpPhBkContext.csproj package Microsoft.EntityFrameworkCore
dotnet add LpPhBkContext/LpPhBkContext.csproj package Microsoft.EntityFrameworkCore.SqlServer
dotnet add LpPhBkContext/LpPhBkContext.csproj reference LpPhBkEntity/LpPhBkEntity.csproj
dotnet new classlib -o LpPhBkViews
dotnet sln PhonebookSolution.sln add LpPhBkViews/LpPhBkViews.csproj --solution-folder Server
dotnet new classlib -o LpPhBkControllers
dotnet sln PhonebookSolution.sln add LpPhBkControllers/LpPhBkControllers.csproj --solution-folder Server
dotnet add LpPhBkControllers/LpPhBkControllers.csproj package Microsoft.EntityFrameworkCore
dotnet add LpPhBkControllers/LpPhBkControllers.csproj package LinqKit.Microsoft.EntityFrameworkCore
dotnet add LpPhBkControllers/LpPhBkControllers.csproj reference LpPhBkEntity/LpPhBkEntity.csproj
dotnet add LpPhBkControllers/LpPhBkControllers.csproj reference LpPhBkContext/LpPhBkContext.csproj
dotnet add LpPhBkControllers/LpPhBkControllers.csproj reference LpPhBkViews/LpPhBkViews.csproj
With any text editor open LpPhBkControllers.csproj and modify <ItemGroup>...<\ItemGroup> as it shown below:
<ItemGroup>
...
<FrameworkReference Include="Microsoft.AspNetCore.App" />
...
</ItemGroup>dotnet new webapi -o LpPhBkWebApp -minimal false
dotnet sln PhonebookSolution.sln add LpPhBkWebApp/LpPhBkWebApp.csproj --solution-folder Server
dotnet add LpPhBkWebApp/LpPhBkWebApp.csproj package LinqKit.Microsoft.EntityFrameworkCore
dotnet add LpPhBkWebApp/LpPhBkWebApp.csproj package Microsoft.AspNetCore.Authentication.JwtBearer
dotnet add LpPhBkWebApp/LpPhBkWebApp.csproj reference LpPhBkContext/LpPhBkContext.csproj
dotnet add LpPhBkWebApp/LpPhBkWebApp.csproj reference LpPhBkViews/LpPhBkViews.csproj
dotnet add LpPhBkWebApp/LpPhBkWebApp.csproj reference LpPhBkControllers/LpPhBkControllers.csproj
- In the following projects remove the file Class1.cs:
- LpPhBkEntity
- LpPhBkContext
- LpPhBkViews
- LpPhBkControllers
- In the following project remove the file WeatherForecastController.cs:
- LpPhBkWebApp
- In the following project remove the file WeatherForecast.cs:
- LpPhBkWebApp
- In the following projects add
PhBkfolder- LpPhBkEntity
- LpPhBkContext
- LpPhBkViews
- In the following projects add
Controllersfolder

- We created the
Directory.Build.props-file with the following content. Read the artricle 004
<Project>
<PropertyGroup>
<DefineConstants>NOTMODELING</DefineConstants>
</PropertyGroup>
</Project>- We saved
Directory.Build.props-file in theE:\Development\PhonebookSolution-folder.