In this task, you will create a new ASP.NET MVC web project, and the SofiaCarRental.Model class library. The web project will be the starting point for your application, and the class library will hold your fluent model.
- Start Visual Studio, on the File menu select New, and then select Project.
- In the New Project dialog box, select Visual Basic or Visual C# as the programming language.
- In the Templates pane, select ASP.NET MVC 4 Web Application.
Type CarRentWebSite as the name of the project and click OK.
In the New ASP.NET MVC 4 Project dialog box, select Internet Application. Leave Razor as the default view engine.
Click OK. Visual Studio will create a new ASP.NET MVC project.
Following the steps in the Creating The SofiaCarRental Model tutorial, create the SofiaCarRental.Model project, which holds the fluent model.
- Integrate the Telerik.DataAccess.Core NuGet package with the CarRentWebSite project.
- In the CarRentWebSite project, add a reference to the SofiaCarRental.Model project.
Copy the SofiaCarRentalConnection connection string from the App.config file of the SofiaCarRental.Model project to the Web.config file of the SofiaCarRentalWebApp project.
<connectionStrings> <add name="SofiaCarRentalConnection" connectionString="data source=.\sqlexpress; initial catalog=SofiaCarRental_v2.2; integrated security=True" providerName="System.Data.SqlClient" /> </connectionStrings>
In Solution Explorer, expand the References node for the CarRentWebSite project. Select the Telerik.OpenAccess.dll assembly, press F4 to open the Properties pane and set the Copy Local property to True.
More information could be found in the Consuming a Model - Configuration topic.
At this point the solution is fully configured. Next, you will learn how to handle the OpenAccessContext in web applications.