自己动手搭建经典的3层 Asp.Net MVC
1:IBaseDAL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks; namespace C01.ZRF.IDAL
{
public interface IBaseDAL<T> where T : class
{ int SaveChanges(); void Add(T model); void Delete(T model); void DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> delWhere); void Modify(T model, params string[] propertyNames); IQueryable<T> Where(Expression<Func<T, bool>> whereLambda); IQueryable<T> WhereOrder<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true); IQueryable<T> WhereInclude(Expression<Func<T, bool>> whereLambda, params string[] includePropertyNames); IQueryable<T> WhereInclude<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); IEnumerable<T> WherePaged<TKey>(int PageIndex, int PageSize, out int totalCount, Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); IQueryable<T> QueryBySql(string sql, params System.Data.SqlClient.SqlParameter[] ps);
}
}
T4模板生成的接口
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF.Utility.CS.ttinclude"#>
<#@ output extension=".cs"#>
<#
CodeGenerationTools code = new CodeGenerationTools(this);
MetadataLoader loader = new MetadataLoader(this);
CodeRegion region = new CodeRegion(this, );
MetadataTools ef = new MetadataTools(this);
string inputFile1 = @"E:\Temp\test01\3LaySolution\C10.ZRF.Model\Model1.edmx";
EdmItemCollection ItemCollection1 = loader.CreateEdmItemCollection(inputFile1);
string namespaceName = code.VsNamespaceSuggestion();
EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this);
#>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C10.ZRF.Model; namespace C01.ZRF.IDAL
{
<#
foreach (EntityType entity in ItemCollection1.GetItems<EntityType>().OrderBy(e => e.Name))
{
#>
public partial interface I<#=entity.Name#>_DAL : IBaseDAL<<#=entity.Name#>>{ }
<#}#>
}
生成后的效果如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C10.ZRF.Model; namespace C01.ZRF.IDAL
{
public partial interface IBuyCar_DAL : IBaseDAL<BuyCar>{ }
public partial interface IMenu_DAL : IBaseDAL<Menu>{ }
public partial interface IProduct_DAL : IBaseDAL<Product>{ }
public partial interface IRole_DAL : IBaseDAL<Role>{ }
public partial interface IroleMenu_DAL : IBaseDAL<roleMenu>{ }
public partial interface IuerRole_DAL : IBaseDAL<uerRole>{ }
public partial interface IUser_DAL : IBaseDAL<User>{ } }
2:DAL
using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Linq.Expressions; namespace C01.ZRF.DAL
{
using C01.ZRF.IDAL;
using IOC;
using System.Data.Entity; public class BaseDAL<T>:IBaseDAL<T> where T:class
{
//1.创建EF上下文
// BaseDBContext db = new BaseDBContext();
DbContext db = DBContextFactory.GetDbContext(); #region 0.0 批量更新EF容器数据到数据库 +int SaveChanges()
/// <summary>
/// 0.0 批量更新EF容器数据到数据库
/// </summary>
/// <returns>返回受影响行数</returns>
public int SaveChanges()
{
return db.SaveChanges();
}
#endregion #region 1.0 新增方法 +void Add(T model)
/// <summary>
/// 1.0 新增方法
/// </summary>
/// <param name="model"></param>
public void Add(T model)
{
//1.直接通过EF上下文的 Set方法 获取一个 针对于 T类 做操作的 DbSet对象
//var dbSet = db.Set<T>();
//dbSet.Add(model);
db.Set<T>().Add(model);
}
#endregion #region 2.0 删除方法 +void Delete(T model)
/// <summary>
/// 2.0 删除方法
/// </summary>
/// <param name="model"></param>
public void Delete(T model)
{
DbEntityEntry entry = db.Entry<T>(model);
entry.State = System.Data.Entity.EntityState.Deleted;
}
#endregion #region 2.1 条件删除方法 +void DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> delWhere)
/// <summary>
/// 2.1 条件删除方法
/// </summary>
/// <param name="delWhere">要删除的元素查询条件</param>
public void DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> delWhere)
{
var delList = db.Set<T>().Where(delWhere);
foreach (T model in delList)
{
Delete(model);
}
}
#endregion #region 3.0 修改实体 + void Modify(T model, params string[] propertyNames)
/// <summary>
/// 3.0 修改实体
/// </summary>
/// <param name="model"></param>
/// <param name="propertyNames"></param>
public void Modify(T model, params string[] propertyNames)
{
DbEntityEntry entry = db.Entry<T>(model);
entry.State = System.Data.Entity.EntityState.Unchanged;
foreach (string proName in propertyNames)
{
entry.Property(proName).IsModified = true;
}
}
#endregion #region 4.0 查询方法 +IQueryable<T> Where(Expression<Func<T, bool>> whereLambda)
/// <summary>
/// 4.0 查询方法
/// </summary>
/// <param name="whereLambda"></param>
/// <returns></returns>
public IQueryable<T> Where(Expression<Func<T, bool>> whereLambda)
{
return db.Set<T>().Where(whereLambda);
}
#endregion #region 4.1 查询方法 -带排序 +IQueryable<T> WhereOrder<TKey>
/// <summary>
/// 4.1 查询方法 -带排序
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <param name="whereLambda"></param>
/// <param name="keySelector">u=></param>
/// <param name="isAsc"></param>
/// <returns></returns>
public IQueryable<T> WhereOrder<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true)
{
if (isAsc)
return db.Set<T>().Where(whereLambda).OrderBy(keySelector);
else
return db.Set<T>().Where(whereLambda).OrderByDescending(keySelector);
}
#endregion #region 4.2 查询方法 -带Include +IQueryable<T> WhereInclude
/// <summary>
/// 4.2 查询方法 -带Include
/// </summary>
/// <param name="whereLambda"></param>
/// <param name="includePropertyNames">要进行连接查询的 属性名</param>
/// <returns></returns>
public IQueryable<T> WhereInclude(Expression<Func<T, bool>> whereLambda, params string[] includePropertyNames)
{
DbQuery<T> dbQuery = db.Set<T>();
foreach (string includeName in includePropertyNames)
{
dbQuery = dbQuery.Include(includeName);
}
return dbQuery.Where(whereLambda); //DbQuery<T> dbSet = (DbQuery<T>)db.Set<T>().Where(whereLambda);
//foreach (string includeName in includePropertyNames)
//{
// dbSet = dbSet.Include(includeName);
//}
//return dbSet;
}
#endregion #region 4.3 查询方法 -带Include 和 排序 +IQueryable<T> WhereInclude<TKey>
/// <summary>
/// 4.3 查询方法 -带Include 和 排序
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <param name="whereLambda"></param>
/// <param name="keySelector"></param>
/// <param name="isAsc"></param>
/// <param name="includePropertyNames"></param>
/// <returns></returns>
public IQueryable<T> WhereInclude<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames)
{
DbQuery<T> dbQuery = db.Set<T>();
if (includePropertyNames != null && includePropertyNames.Length > )
{
foreach (string includeName in includePropertyNames)
{
dbQuery = dbQuery.Include(includeName);
}
}
IQueryable<T> query = dbQuery.Where(whereLambda);
if (isAsc)
return query.OrderBy(keySelector);
else
return query.OrderByDescending(keySelector);
}
#endregion #region 4.4 查询方法 - 分页+Include+排序 + void WherePaged<TKey>
/// <summary>
/// 4.4 查询方法 - 分页+Include+排序
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <param name="pagedData"></param>
/// <param name="whereLambda"></param>
/// <param name="keySelector"></param>
/// <param name="isAsc"></param>
/// <param name="includePropertyNames"></param>
public IEnumerable<T> WherePaged<TKey>(int PageIndex, int PageSize, out int totalCount, Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames)
{
//0.获取 要操作的 数据表 对应的查询对象
DbQuery<T> dbQuery = db.Set<T>();
if (includePropertyNames != null && includePropertyNames.Length > )
{
foreach (string includeName in includePropertyNames)
{
dbQuery = dbQuery.Include(includeName);
}
} IOrderedQueryable<T> orderQuery = null;
//2.排序
if (isAsc) { orderQuery = dbQuery.OrderBy(keySelector); }
else { orderQuery = dbQuery.OrderByDescending(keySelector); }
//3.分页查询
var list = orderQuery.Where(whereLambda).Skip((PageIndex - ) * PageSize).Take(PageSize).ToList();
//4.获取总行数
totalCount = orderQuery.Where(whereLambda).Count();
return list;
}
#endregion #region 4.5 查询方法 QueryBySql(string sql, params System.Data.SqlClient.SqlParameter[] ps) SQl语句的查询方法
public IQueryable<T> QueryBySql(string sql, params System.Data.SqlClient.SqlParameter[] ps)
{
return db.Database.SqlQuery<T>(sql, ps).AsQueryable();
}
#endregion
}
}
T4模板生成的代码如下:
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF.Utility.CS.ttinclude"#>
<#@ output extension=".cs"#>
<#
CodeGenerationTools code = new CodeGenerationTools(this);
MetadataLoader loader = new MetadataLoader(this);
CodeRegion region = new CodeRegion(this, );
MetadataTools ef = new MetadataTools(this);
string inputFile1 = @"E:\Temp\test01\3LaySolution\C10.ZRF.Model\Model1.edmx";
EdmItemCollection ItemCollection1 = loader.CreateEdmItemCollection(inputFile1);
string namespaceName = code.VsNamespaceSuggestion();
EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this);
#>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C01.ZRF.IDAL;
using C10.ZRF.Model; namespace C01.ZRF.DAL
{
<#
foreach (EntityType entity in ItemCollection1.GetItems<EntityType>().OrderBy(e => e.Name))
{
#>
public partial class <#=entity.Name#>_DAL : BaseDAL<<#=entity.Name#>>,I<#=entity.Name#>_DAL{ }
<#}#>
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C01.ZRF.IDAL;
using C10.ZRF.Model; namespace C01.ZRF.DAL
{
public partial class BuyCar_DAL : BaseDAL<BuyCar>,IBuyCar_DAL{ }
public partial class Menu_DAL : BaseDAL<Menu>,IMenu_DAL{ }
public partial class Product_DAL : BaseDAL<Product>,IProduct_DAL{ }
public partial class Role_DAL : BaseDAL<Role>,IRole_DAL{ }
public partial class roleMenu_DAL : BaseDAL<roleMenu>,IroleMenu_DAL{ }
public partial class uerRole_DAL : BaseDAL<uerRole>,IuerRole_DAL{ }
public partial class User_DAL : BaseDAL<User>,IUser_DAL{ } }
3:IBLL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks; namespace C01.ZRF.IBLL
{
public interface IBaseBLL<T>where T:class
{
int SaveChanges(); void Add(T model); void Delete(T model); void DeleteBy(Expression<Func<T, bool>> delWhere); void Modify(T model, params string[] propertyNames); IQueryable<T> Where(Expression<Func<T, bool>> whereLambda); IQueryable<T> WhereOrder<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true); IQueryable<T> WhereInclude(Expression<Func<T, bool>> whereLambda, params string[] includePropertyNames); IQueryable<T> WhereInclude<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); IEnumerable<T> WherePaged<TKey>(int PageIndex, int PageSize, out int totalCount, Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); IQueryable<T> QueryBySql(string sql, params System.Data.SqlClient.SqlParameter[] ps);
}
}
T4代码生成器:
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF.Utility.CS.ttinclude"#>
<#@ output extension=".cs"#>
<#
CodeGenerationTools code = new CodeGenerationTools(this);
MetadataLoader loader = new MetadataLoader(this);
CodeRegion region = new CodeRegion(this, );
MetadataTools ef = new MetadataTools(this);
string inputFile1 = @"E:\Temp\test01\3LaySolution\C10.ZRF.Model\Model1.edmx";
EdmItemCollection ItemCollection1 = loader.CreateEdmItemCollection(inputFile1);
string namespaceName = code.VsNamespaceSuggestion();
EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this);
#>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C10.ZRF.Model; namespace C01.ZRF.IBLL
{
<#
foreach (EntityType entity in ItemCollection1.GetItems<EntityType>().OrderBy(e => e.Name))
{
#>
public partial interface I<#=entity.Name#>_BLL : IBaseBLL<<#=entity.Name#>>{ }
<#}#>
}
效果如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C10.ZRF.Model; namespace C01.ZRF.IBLL
{
public partial interface IBuyCar_BLL : IBaseBLL<BuyCar>{ }
public partial interface IMenu_BLL : IBaseBLL<Menu>{ }
public partial interface IProduct_BLL : IBaseBLL<Product>{ }
public partial interface IRole_BLL : IBaseBLL<Role>{ }
public partial interface IroleMenu_BLL : IBaseBLL<roleMenu>{ }
public partial interface IuerRole_BLL : IBaseBLL<uerRole>{ }
public partial interface IUser_BLL : IBaseBLL<User>{ } }
4:BLL
using System;
using System.Collections.Generic;
using System.Linq; namespace C01.ZRF.BLL
{
using C01.ZRF.IBLL;
using C01.ZRF.IDAL;
using System.Data.SqlClient;
public partial class BaseBLL<T> : IBaseBLL<T> where T : class
{
protected IBaseDAL<T> basedal;
public void Add(T model)
{
basedal.Add(model);
} public void Delete(T model)
{
basedal.Delete(model);
} public void DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> delWhere)
{
basedal.DeleteBy(delWhere);
} public void Modify(T model, params string[] propertyNames)
{
basedal.Modify(model, propertyNames);
} public IQueryable<T> QueryBySql(string sql, params SqlParameter[] ps)
{
return basedal.QueryBySql(sql, ps);
} public int SaveChanges()
{
return basedal.SaveChanges();
} public IQueryable<T> Where(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda)
{
return basedal.Where(whereLambda);
} public IQueryable<T> WhereInclude(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda, params string[] includePropertyNames)
{
return basedal.WhereInclude(whereLambda, includePropertyNames);
} public IQueryable<T> WhereInclude<TKey>(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda, System.Linq.Expressions.Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames)
{
return basedal.WhereInclude<TKey>(whereLambda, keySelector, isAsc, includePropertyNames);
} public IQueryable<T> WhereOrder<TKey>(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda, System.Linq.Expressions.Expression<Func<T, TKey>> keySelector, bool isAsc = true)
{
return basedal.WhereOrder<TKey>(whereLambda, keySelector, isAsc);
} public IEnumerable<T> WherePaged<TKey>(int PageIndex, int PageSize, out int totalCount, System.Linq.Expressions.Expression<Func<T, bool>> whereLambda, System.Linq.Expressions.Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames)
{
return basedal.WherePaged<TKey>(PageIndex, PageSize, out totalCount, whereLambda, keySelector, isAsc, includePropertyNames);
}
}
}
T4模板生成器:
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF.Utility.CS.ttinclude"#>
<#@ output extension=".cs"#>
<#
CodeGenerationTools code = new CodeGenerationTools(this);
MetadataLoader loader = new MetadataLoader(this);
CodeRegion region = new CodeRegion(this, );
MetadataTools ef = new MetadataTools(this);
string inputFile1 = @"E:\Temp\test01\3LaySolution\C10.ZRF.Model\Model1.edmx";
EdmItemCollection ItemCollection1 = loader.CreateEdmItemCollection(inputFile1);
string namespaceName = code.VsNamespaceSuggestion();
EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this);
#>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C10.ZRF.Model;
using C01.ZRF.IBLL;
using C01.ZRF.IDAL;
namespace C01.ZRF.BLL
{
<#
foreach (EntityType entity in ItemCollection1.GetItems<EntityType>().OrderBy(e => e.Name))
{
#>
public partial class <#=entity.Name#>_BLL : BaseBLL<<#=entity.Name#>>,I<#=entity.Name#>_BLL{
I<#=entity.Name#>_DAL dal;
public <#=entity.Name#>_BLL(I<#=entity.Name#>_DAL dal){
this.dal=dal; base.basedal=dal;
}
}
<#}#>
}
效果如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace C01.ZRF.BLL
{
using C10.ZRF.Model;
using C01.ZRF.IBLL;
using C01.ZRF.IDAL;
public partial class RoleBLL : BaseBLL<Role>, IRole_BLL
{
IRole_DAL dal;
public RoleBLL(IRole_DAL dal) {
this.dal = dal;
base.basedal = dal;
}
}
}
5:AutoFac配置文件内容
using Autofac;
using Autofac.Integration.Mvc;
using System.Reflection; namespace WebApplication1
{
public class AutoFacConfig
{
public static void Register()
{
//1.0 创建一个autofac的容器创建者对象
var builder = new ContainerBuilder(); //2.0 告诉autofac控制器类所存储的程序集是谁
Assembly controllerAss = Assembly.Load("WebApplication1");
builder.RegisterControllers(controllerAss); //3.0 将仓储层中的所有的类实例化以其接口的形式存储起来
Assembly dalAss = Assembly.Load("C01.ZRF.DAL");
builder.RegisterTypes(dalAss.GetTypes()).AsImplementedInterfaces(); //4.0 将业务逻辑层中的所有的类实例化以其接口的形式存储起来
Assembly bllAss = Assembly.Load("C01.ZRF.BLL");
builder.RegisterTypes(bllAss.GetTypes()).AsImplementedInterfaces(); //5.0 告诉MVC底层控制器的对象创建工作被autofac替代
//5.0.1 创建一个真正的autofac工作容器
var c = builder.Build(); //5.0.2 将auto发出工作容器替换MVC底层
System.Web.Mvc.DependencyResolver.SetResolver(new AutofacDependencyResolver(c));
}
}
}
配置后再去Global.asax 全局文件里面注册即可:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AutoFacConfig.Register();//------ }
6:Web端来调用:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc; namespace WebApplication1.Controllers
{
using C01.ZRF.IBLL;
using C10.ZRF.Model.ModelView;
using COMMOM;
using C10.ZRF.Model.Filter;
using System.Threading.Tasks;
using C10.ZRF.Model; // [WebApplication1._Filters.ZrfComparess]
public class HomeController : Controller
{
public ActionResult DoCombresTest() {
return View();
} #region MyRegion
IBuyCar_BLL bll;
public HomeController(IBuyCar_BLL bll)
{
this.bll = bll;
}
// GET: Home
public ActionResult Index()
{
ViewBag.car = bll.Where(c => c.cid == ).FirstOrDefault().pcount;
ViewBag.time = "时间是=" + DateTime.Now.ToString();
return View();
}
}
}
自己动手搭建经典的3层 Asp.Net MVC的更多相关文章
- Win7环境 搭建IIS环境。发布asp.net MVC项目到IIS(第二期)
在IIS环境中给发布项目修改域名,192.168.1.1:8081 ---->> www.preject.com 一.在网站主页中,1找到绑定网站.2编辑. 二.修改网站配置参数. 三. ...
- Win7环境 搭建IIS环境。发布asp.net MVC项目到IIS(第一期)
一.右键添加网站,输入网站基本配置信息. 二.成功添加网站后,应用程序池里会多一个应用,版本一定要改成4.0,并且模式是集成模式,否则项目报错(原因可以看配置文件中的版本信息). 三.再启用项目时可能 ...
- ASP.NET MVC项目框架快速搭建实战
MVC项目搭建笔记---- 项目框架采用ASP.NET MVC+Entity Framwork+Spring.Net等技术搭建,采用”Domain Model as View Model“的MVC开发 ...
- Unity + iBatis + Asp.net Mvc 系统搭建
Unity + iBatis + Asp.net Mvc 系统搭建 之前用EntityFramework Code First做了一些小项目,很是方便:后来在一个 Java 项目中接触了myBatis ...
- 4、ASP.NET MVC入门到精通——NHibernate构建一个ASP.NET MVC应用程序
下周就去办理离职手续了,之前没有使用过NHibernate,只知道NHibernate是一种ORM框架,但是听说新公司是使用NHibernate在做项目,所以,我就网上找资料学习一下NHibernat ...
- NHibernate构建一个ASP.NET MVC应用程序
NHibernate构建一个ASP.NET MVC应用程序 什么是Nhibernate? NHibernate是一个面向.NET环境的对象/关系数据库映射工具.对象/关系数据库映射(object/re ...
- ASP.NET MVC企业级项目框架
ASP.NET MVC企业级项目框架 MVC项目搭建笔记---- 项目框架采用ASP.NET MVC+Entity Framwork+Spring.Net等技术搭建,搭建过程内容比较多,结合了抽象工厂 ...
- ASP.NET MVC 概述
目标:学习ASP.NET MVC 和ASP.NET WebForm的不同之处.学习在合适的地方使用ASP.NET MVC. MVC(Model-View-Controller)结构模式把一个对象分离成 ...
- asp.net mvc 简单项目框架的搭建过程(一)对Bll层和Dal层进行充分解耦
学习asp.net 已经有近三个月的时间了,在asp.net mvc上花的时间最多,但个人真是有些菜,不得不说,asp.net mvc的水真的还是蛮深的.目前在公司实习,也见过公司几个项目的代码了.对 ...
随机推荐
- Java的23种设计模式,详细讲解(一)
本人免费整理了Java高级资料,涵盖了Java.Redis.MongoDB.MySQL.Zookeeper.Spring Cloud.Dubbo高并发分布式等教程,一共30G,需要自己领取.传送门:h ...
- PHP入门了解
1.五个基本概念 1.1静态页面和动态页面 静态页面:服务器不执行的页面 动态页面:服务器执行的页面 1.2客户端和服务器端 客户端:浏览器就是客户端 服务器端:给浏览者提供服务 1.3端 ...
- Latex学习笔记 第一章
1.使用空行分段. 空行只起分段的作用,使用过多的空行并不起增大段间间距的作用. 2.段前不用打空格,LateX会自动完成文字的缩进. 即使打了也会被自动忽略. 3.通常汉字后面的空格会被忽略,其他符 ...
- MySQL入门——MySQL数据库和SQL语言
MySQL入门——MySQL数据库和SQL语言 摘要:本文主要了解了MySQL关系型数据库和SQL语言的基本知识. MySQL数据库 简介 MySQL是一个关系型数据库管理系统,由瑞典MySQL AB ...
- Python【day 15-2】基本数据类型-dict tuple set
'''''' ''' 变量的数据类型 int str bool list 5.字典 dict 定义和写法:由{}表示,每个元素是key:value的键值对形式,元素间是逗号隔开 特点: 1.key是可 ...
- 微信小程序动画之圆形进度条
微信小程序动画之圆形进度条 上图: js: //获取应用实例 var app = getApp() var interval; var varName; var ctx = wx.createCanv ...
- 论文学习-wlg-基于二维材料的肖特基异质结构的通用尺度定律
目录 主要公式: 各个段落的内容 第一页 第二页 第三页 名词的含义 功函数: 电子亲和力 肖特基势垒 肖特基二极管的原理 非相对论性电子气:未知 Rashba自旋电子系统: 参考链接: 主要公式: ...
- 微服务:Eureka+Zuul+Ribbon+Feign+Hystrix构建微服务架构
原文地址:http://blog.csdn.net/qq_18675693/article/details/53282031 本案例将打架一个微服务框架,参考来源官方参考文档 微服务:是什么?网上有一 ...
- mysql-操作篇
# ### mysqlctrl + l 清屏ctrl + c 终止[linux]service mysql start 启动mysqlservice mysql stop 停止mysqlservice ...
- Python继承、多继承、魔术方法
继承和多继承的概念和使用 super的用法 __str__ __repr__ __call__ 多继承方法解析顺序和Mix-in开发模式 魔术方法原理和作用 继承 定义类的时候,在类名后面的括号里填继 ...