Setup Web API and Entity Framework - Part 1
Setup Ionic/android mobile Environment - Part 2
Let us build an Angular 2 application with .Net Backend, supported by SQL database using entity framework, let just jump into creating an application.
Setup Ionic/android mobile Environment - Part 2
Let us build an Angular 2 application with .Net Backend, supported by SQL database using entity framework, let just jump into creating an application.
- Select ASP.Net Web Application
- Select Web API and change the authentication to None
- Rename the ValuesController to TodoController
- Test http://localhost:{portno}/api/Todo
- Add Entity framework Reference to Project, Add Reference -> Manage Nuget Package-> click on browse -> search for “Entity”
- Add Todo model into the model folder.
- Add SqlDB inside the folder, which inherits DbContext, make sure you add using System.Data.Entity;
- Add defaultconnection in web.config as below, (this should be below </appSettings>)
<connectionStrings>
<add name="defaultconnection" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=tododb;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
- Add below code in Get and Post methods to create/access database
Setup Ionic/android mobile Environment - Part 2
No comments:
Post a Comment
Note: only a member of this blog may post a comment.