App-Management News

Build a web application for management news.

Table of contents


Introduce application

  • This project support manage the news in page and user join page and post news.

Theoretical basis

Entity framework

  • Entity Framework is an open-source ORM framework for .NET applications supported by Microsoft. It enables developers to work with data using objects of domain specific classes without focusing on the underlying database tables and columns where this data is stored. With the Entity Framework, developers can work at a higher level of abstraction when they deal with data, and can create and maintain data-oriented applications with less code compared with traditional applications.
  • Have three way create model in entity framework: model first, code first, database first

Repository

  • Repository pattern, it provides an abstraction of data, so that your application can work with a simple abstraction that has an interface approximating that of a collection. Adding, removing, updating, and selecting items from this collection is done through a series of straightforward methods, without the need to deal with database concerns like connections, commands, cursors, or readers. Using this pattern can help achieve loose coupling and can keep domain objects persistence ignorant.

Unit of work

  • UoW is to store all Repositories and ensure that those Repositories share a single DbContext, thereby creating transactions - all database update operations by Repositories in the same business action will either be successful or fail. in order to ensure the consistent of data.

Usage

  • First step: clone source code
git clone https://github.com/nhattan1504/App-Management
  • Second step: install microsoft entity framework and Microsoft.AspNet.Mvc,cloudscribe.Pagination.Model and cloudscribe.Web.Pagination.
  • Third step: install sql server and run application.

Template home

Template admin

  • Help admin manage user create post and user use app.

Template user

  • Help user create post

Detail

Reference

Repository Và Unit Of Work
EF and MVC tutorial