ASP.NET MVC Razor.
Working with data
Table of contents
1. Razor code expressions
2. Razor code blocks
3. Partial views
4. Working with data
1. Entity Framework architecture
2. Database-First
3. Code-First
Razor code expressions
Razor code blocks
Working with data
Entity Framework architecture
Entity Framework work approaches
• Database First
 Designer
 Write more SQL
 Better data performance capabilities
• Code First
 No designer
 Almost no SQL
 Faster development
 Better code architecture
 Building more complex data model made easy
Resources
• Using EF & ASP.NET MVC - https://docs.microsoft.com/en-
us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-
mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-
application
• Code First Migrations - https://docs.microsoft.com/en-
us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-
mvc/migrations-and-deployment-with-the-entity-framework-in-an-asp-net-
mvc-application
• Stored Procedures in MVC - https://docs.microsoft.com/en-
us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-
mvc/async-and-stored-procedures-with-the-entity-framework-in-an-asp-net-
mvc-application
Homework
• Implement Categories CRUD model
 List all categories
 Add categories
 Edit categories
 Delete categories
• Implement the same for the Notes if you didn`t manage to do it last time
Questions?
Thank you
Vladislav Hadzhiyski
Email: Vladislav.Hadzhiyski@gmail.com, Vladislav.Hadzhiyski@experian.com

Mvc razor and working with data

  • 1.
  • 2.
    Table of contents 1.Razor code expressions 2. Razor code blocks 3. Partial views 4. Working with data 1. Entity Framework architecture 2. Database-First 3. Code-First
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
    Entity Framework workapproaches • Database First  Designer  Write more SQL  Better data performance capabilities • Code First  No designer  Almost no SQL  Faster development  Better code architecture  Building more complex data model made easy
  • 8.
    Resources • Using EF& ASP.NET MVC - https://docs.microsoft.com/en- us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using- mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc- application • Code First Migrations - https://docs.microsoft.com/en- us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using- mvc/migrations-and-deployment-with-the-entity-framework-in-an-asp-net- mvc-application • Stored Procedures in MVC - https://docs.microsoft.com/en- us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using- mvc/async-and-stored-procedures-with-the-entity-framework-in-an-asp-net- mvc-application
  • 9.
    Homework • Implement CategoriesCRUD model  List all categories  Add categories  Edit categories  Delete categories • Implement the same for the Notes if you didn`t manage to do it last time
  • 10.
  • 11.
    Thank you Vladislav Hadzhiyski Email:Vladislav.Hadzhiyski@gmail.com, Vladislav.Hadzhiyski@experian.com

Editor's Notes

  • #5 It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application. It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure It provides better support for test-driven development (TDD). It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.