Sunday, 23 April 2017

Angular 2 TODO App with Ionic 2, Web API.Net, Entity Framework (3 series) – Part 1


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.  
  1. Select ASP.Net Web Application
  1. Select Web API and change the authentication to None
  1. Rename the ValuesController to TodoController
  1. Test http://localhost:{portno}/api/Todo

  1. Add Entity framework Reference to Project, Add Reference -> Manage Nuget Package-> click on browse -> search for “Entity”

  1. Add Todo model into the model folder.
  1. Add SqlDB inside the folder, which inherits DbContext, make sure you add using System.Data.Entity;
  1. 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>
  1. Add below code in Get and Post methods to create/access database

Setup Ionic/android mobile Environment - Part 2








Understand and Implement Roles Vs Claims Based authentication in MVC Web API

In this blog, you will learn on how to Implement Roles and claims based authentication. You will also understand what is the difference b...