SharePoint Cloud hosted Apps Girish
SharePoint Development Challenges Code runs in full trust code Developers need a dedicated SharePoint server
SharePoint Apps Apps cannot run SharePoint server side API code instead use REST/CSOM App Solution does not live on SharePoint instead Executes at the client context(Browser) or at a different server(IIS server or Azure) and hence isolated from SharePoint Apps are given permissions to SharePoint using OAuth Developers need not Know SharePoint API and can use REST and OAuth(Industry based) for communication with SharePoint
Your Hosted Site (MVC on IIS) Cloud Hosted Apps Cloud Hosted app Provider-hosted App “Bring your own server hosting infrastructure” SharePoint Web Your Hosted Site (MVC on IIS) Auto-hosted App Windows Azure + SQL Azure provisioned automatically as apps are installed SharePoint Web Azure
Why MVC Enables the full control over the rendered HTML. Enables Test Driven Development(TDD) Following the design of stateless nature of the web.
How MVC Works The Model is the part of the application that handles the logic for the application data. Often model objects retrieve data (and store data) from a database. The View is the parts of the application that handles the display of the data. Most often the views are created from the model data. The Controller is the part of the application that handles user interaction. Typically controllers read data from a view, control user input, and send input data to the model.
How MVC Works User enters the URL Route handler parser the URL and decides on which controller to run Controller contain actions methods which act on the model Controller renders the result to view engine
View Two ways of data communication View bag(loosely coupled) View model(tightly coupled)
Entity framework Relational Mapping Framework Approaches Maps .NET objects to relational databases which simplifies data access. Approaches Code First Database First Model First
MVC App Demo
Default MVC Router
Model
Install Entity Framework
DBContext
Connection String
Scaffold
Songs controller
Songs link
App
Create
List Songs
Retain SharePoint Context