MVC5+EF6三层
1.新建一个空白解决方案名称为Company
2.在该解决方案下,新建解决方案文件夹(UI,BLL,DAL,Model) 当然还可以加上common
3.分别在BLL,DAL,Model 解决方案文件夹下创建类库项目
(1).BLL解决方案文件夹: Company.BLL、Company.IBLL、Company.BLLContainer
(2).DAL解决方案文件夹: Company.DAL、Company.IDAL、Company.DALContainer
(3).Model解决方案文件夹:Company.Model
4.在UI 解决方案文件夹下添加一个ASP.NET Web应用程序,名称为Company.UI,选择我们的Mvc模板.
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-11-29 11:24 Example
目录 0 2016-11-29 11:25 Example.vs
目录 0 2016-11-29 11:25 Example.vsconfig
文件 83460 2016-11-29 11:25 Example.vsconfigapplicationhost.config
目录 0 2016-11-29 11:24 Example.vsExample
目录 0 2016-11-29 11:24 Example.vsExamplev14
文件 126464 2016-11-29 11:41 Example.vsExamplev14.suo
目录 0 2016-11-17 12:58 ExampleBLL
文件 8030 2016-11-17 12:58 ExampleBLLaseService.cs
目录 0 2016-11-17 10:40 ExampleBLLin
目录 0 2016-11-17 13:11 ExampleBLLinDebug
文件 7168 2016-11-29 12:06 ExampleBLLinDebugBLL.dll
文件 26112 2016-11-29 12:06 ExampleBLLinDebugBLL.pdb
文件 12800 2016-11-29 12:06 ExampleBLLinDebugDAL.dll
文件 36352 2016-11-29 12:06 ExampleBLLinDebugDAL.pdb
文件 5196496 2016-11-17 10:36 ExampleBLLinDebugEntityframework.dll
文件 177664 2016-11-17 11:18 ExampleBLLinDebugEntityframework.Extended.dll
文件 223368 2016-11-17 11:18 ExampleBLLinDebugEntityframework.Extended.xml
文件 3652961 2016-11-17 10:36 ExampleBLLinDebugEntityframework.xml
文件 5632 2016-11-29 12:06 ExampleBLLinDebugMODEL.dll
文件 13824 2016-11-29 12:06 ExampleBLLinDebugMODEL.pdb
目录 0 2016-11-17 10:40 ExampleBLLinRelease
文件 2875 2016-11-17 13:02 ExampleBLLBLL.csproj
目录 0 2016-11-17 10:40 ExampleBLLobj
目录 0 2016-11-29 12:06 ExampleBLLobjDebug
文件 1260 2016-11-17 13:11 ExampleBLLobjDebugBLL.csproj.FileListAbsolute.txt
文件 27480 2016-11-29 12:06 ExampleBLLobjDebugBLL.csprojResolveAssemblyReference.cache
文件 7168 2016-11-29 12:06 ExampleBLLobjDebugBLL.dll
文件 26112 2016-11-29 12:06 ExampleBLLobjDebugBLL.pdb
文件 6798 2016-11-29 11:25 ExampleBLLobjDebugDesignTimeResolveAssemblyReferencesInput.cache
文件 0 2016-11-17 10:40 ExampleBLLobjDebugTemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
............此处省略719个文件信息
using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.expressions;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public abstract class baseService where T : class
{
protected baseRepository CurrentRepository { get; set; }
public baseService(baseRepository currentRepository) { CurrentRepository = currentRepository; }
///
/// 释放
///
public void Dispose() { CurrentRepository.Dispose(); }
///
/// 根据条件判断个数
///
///
///
public int Count(expression> predicate) { return CurrentRepository.Count(predicate); }
///
/// 根据条件判断是否存在
///
///
///
public bool Exist(expression> anyLambda) { return CurrentRepository.Exist(anyLambda); }
///
/// 获取所有列表
///
///
public List GetListAll() { return CurrentRepository.GetAll(); }
///
/// 根据主键获取单个实体对象
///
///
///
public T GetEntity(object id) { return CurrentRepository.Find(id); }
///
/// 添加实体对象
///
///
///
public T Add(T entity) { return CurrentRepository.Add(entity); }
///
/// 添加实体对象
///
///
/// 返回bool
public bool Create(T entity) { return CurrentRepository.Create(entity); }
///
/// 更新实体对象
///
///
///
public bool Update(T entity) { return CurrentRepository.Update(entity); }
///
/// 根据条件批量修改
///
///
/// pression“>
///
public bool UpdateWhere(expression> whereLamdba expression> updateexpression) { return CurrentRepository.UpdateWhere(whereLamdba updateexpression); }
///
/// 删除实体对象(假删除)
///
/// 必须有ShanChuBiaoJi和ID字段
///
public bool Delete(T entity) { return CurrentRepository.Delete(entity); }
///
/// 删除实体对象(假删除)
///
/// 对象
/// 主键ID值
///
public
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-11-29 11:24 Example
目录 0 2016-11-29 11:25 Example.vs
目录 0 2016-11-29 11:25 Example.vsconfig
文件 83460 2016-11-29 11:25 Example.vsconfigapplicationhost.config
目录 0 2016-11-29 11:24 Example.vsExample
目录 0 2016-11-29 11:24 Example.vsExamplev14
文件 126464 2016-11-29 11:41 Example.vsExamplev14.suo
目录 0 2016-11-17 12:58 ExampleBLL
文件 8030 2016-11-17 12:58 ExampleBLLa
目录 0 2016-11-17 10:40 ExampleBLLin
目录 0 2016-11-17 13:11 ExampleBLLinDebug
文件 7168 2016-11-29 12:06 ExampleBLLinDebugBLL.dll
文件 26112 2016-11-29 12:06 ExampleBLLinDebugBLL.pdb
文件 12800 2016-11-29 12:06 ExampleBLLinDebugDAL.dll
文件 36352 2016-11-29 12:06 ExampleBLLinDebugDAL.pdb
文件 5196496 2016-11-17 10:36 ExampleBLLinDebugEntityfr
文件 177664 2016-11-17 11:18 ExampleBLLinDebugEntityfr
文件 223368 2016-11-17 11:18 ExampleBLLinDebugEntityfr
文件 3652961 2016-11-17 10:36 ExampleBLLinDebugEntityfr
文件 5632 2016-11-29 12:06 ExampleBLLinDebugMODEL.dll
文件 13824 2016-11-29 12:06 ExampleBLLinDebugMODEL.pdb
目录 0 2016-11-17 10:40 ExampleBLLinRelease
文件 2875 2016-11-17 13:02 ExampleBLLBLL.csproj
目录 0 2016-11-17 10:40 ExampleBLLobj
目录 0 2016-11-29 12:06 ExampleBLLobjDebug
文件 1260 2016-11-17 13:11 ExampleBLLobjDebugBLL.csproj.FileListAbsolute.txt
文件 27480 2016-11-29 12:06 ExampleBLLobjDebugBLL.csprojResolveAssemblyReference.cache
文件 7168 2016-11-29 12:06 ExampleBLLobjDebugBLL.dll
文件 26112 2016-11-29 12:06 ExampleBLLobjDebugBLL.pdb
文件 6798 2016-11-29 11:25 ExampleBLLobjDebugDesignTimeResolveAssemblyReferencesInput.cache
文件 0 2016-11-17 10:40 ExampleBLLobjDebugTemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
............此处省略719个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)