Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads
 
Add your own
alternative version
Go to top

Architecture Guide: ASP.NET MVC Framework + N-tier + Entity Framework and Many More

, 21 Nov 2013
If you want to use ASP.NET MVC framework but is strugling to get things arrange to confidently use for your next business project. This Article is just for you. The article guide you to use ASP.NET MVC framework to architect a small Document Management System.
MvcDemo.zip
MvcDemo
MvcDeme.Core
bin
Debug
AutoMapper.dll
log4net.dll
Microsoft.Practices.ServiceLocation.dll
MvcDemo.Common.dll
MvcDemo.Common.pdb
MvcDemo.Core.dll
MvcDemo.Core.pdb
MvcDemo.Dal.dll
MvcDemo.Dal.pdb
ClassDiagramService.cd
Interfaces
Mapping
Models
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
MvcDemo.Core.dll
MvcDemo.Core.pdb
ResolveAssemblyReference.cache
TempPE
Properties
MvcDemo
App_Data
DMS_Backup
bin
AutoMapper.dll
log4net.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.Configuration.dll
Microsoft.Practices.Unity.Configuration.pdb
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.Configuration.dll
Microsoft.Practices.Unity.Interception.Configuration.pdb
Microsoft.Practices.Unity.Interception.dll
Microsoft.Practices.Unity.Interception.pdb
Microsoft.Practices.Unity.pdb
MvcDemo.Common.dll
MvcDemo.Common.pdb
MvcDemo.Core.dll
MvcDemo.Core.pdb
MvcDemo.Dal.dll
MvcDemo.Dal.pdb
MvcDemo.dll
MvcDemo.pdb
Content
bg_body.jpg
bg_header.jpg
link_document.png
link_external.png
link_image.png
roundcorner_bottomright.png
roundcorner_topleft.png
Controllers
Global.asax
Infrastracture
Mvc
Models
MvcDemo.csproj.user
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
MvcDemo.dll
MvcDemo.pdb
ResolveAssemblyReference.cache
TempPE
Properties
Scripts
Views
Account
Dms
Home
Shared
ControlsDms
ControlsNav
MvcDemo.Common
bin
Debug
AutoMapper.dll
log4net.dll
MvcDemo.Common.dll
MvcDemo.Common.pdb
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
MvcDemo.Common.dll
MvcDemo.Common.pdb
TempPE
Properties
MvcDemo.Dal
bin
Debug
Microsoft.Practices.ServiceLocation.dll
MvcDemo.Dal.dll
MvcDemo.Dal.pdb
ClassDiagram.Dal.cd
EntityModels
DmsModel.edmx
Infrastructure
Interfaces
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
edmxResourcesToEmbed
DmsEntities
DmsModel.csdl
DmsModel.msl
DmsModel.ssdl
EF
DmsModel.csdl
DmsModel.msl
DmsModel.ssdl
EntityModels
DmsModel.csdl
DmsModel.msl
DmsModel.ssdl
MvcDemo.Dal.dll
MvcDemo.Dal.pdb
TempPE
EntityModels.DmsModel.Designer.cs.dll
Properties
MvcDemo.suo
MvcDemo.Tests
bin
Debug
AutoMapper.dll
log4net.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.pdb
MvcDemo.Common.dll
MvcDemo.Common.pdb
MvcDemo.Core.dll
MvcDemo.Core.pdb
MvcDemo.Dal.dll
MvcDemo.Dal.pdb
MvcDemo.dll
MvcDemo.pdb
MvcDemo.Tests.dll
MvcDemo.Tests.pdb
Controllers
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
MvcDemo.Tests.dll
MvcDemo.Tests.pdb
ResolveAssemblyReference.cache
TempPE
Properties
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace MvcDemo.Core.Interfaces
{
    public interface IService<T> 
    {
        /// <summary>
        /// Get a selected extiry by the object primary key ID
        /// </summary>
        /// <param name="id">Primary key ID</param>
        T GetSingle(Expression<Func<T, bool>> whereCondition);

        /// <summary> 
        /// Add entity to the repository 
        /// </summary> 
        /// <param name="entity">the entity to add</param> 
        /// <returns>The added entity</returns> 
        void Add(T entity);

        /// <summary> 
        /// Mark entity to be deleted within the repository 
        /// </summary> 
        /// <param name="entity">The entity to delete</param> 
        void Delete(T entity);

        /// <summary> 
        /// Updates entity within the the repository 
        /// </summary> 
        /// <param name="entity">the entity to update</param> 
        /// <returns>The updates entity</returns> 
        void Update(T entity);

        /// <summary> 
        /// Load the entities using a linq expression filter
        /// </summary> 
        /// <typeparam name="E">the entity type to load</typeparam> 
        /// <param name="where">where condition</param> 
        /// <returns>the loaded entity</returns> 
        IList<T> GetAll(Expression<Func<T, bool>> whereCondition);

        /// <summary>
        /// Get all the element of this repository
        /// </summary>
        /// <returns></returns>
        IList<T> GetAll();

        /// <summary> 
        /// Query entities from the repository that match the linq expression selection criteria
        /// </summary> 
        /// <typeparam name="E">the entity type to load</typeparam> 
        /// <param name="where">where condition</param> 
        /// <returns>the loaded entity</returns> 
        IQueryable<T> Query(Expression<Func<T, bool>> whereCondition);

        /// <summary>
        /// Count using a filer
        /// </summary>
        long Count(Expression<Func<T, bool>> whereCondition);

        /// <summary>
        /// All item count
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        long Count();
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Nirosh
Architect MAS Holdings
Sri Lanka Sri Lanka
In-depth coverage of Microsoft .Net, Cloud and many other cutting-edge Technologies.
 
- The Mandelbrot set – someone has called it the thumb-print of God – is one of the most beautiful and remarkable discoveries in the entire history of mathematics. My profile picture is generated with that equation.
 
You may contact Nirosh for Consultations, Code Reviews and Architecture Guide Workshops via c_nir*o*sh@hotmail.com (Remove * to use)
 

View Nirosh L.W.C.'s profile on LinkedIn
Follow on   Twitter   Google+

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 22 Nov 2013
Article Copyright 2010 by Nirosh
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid