随笔分类 - EntityFramework
摘要:[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)] public class PowerAttribute : FilterAttr...
阅读全文
摘要:基本都是采用pure设计(中文官网:http://purecss.org,英文官网:http://purecss.io)。pure只是一个简单强大的cssUI库,支持响应式设计,适合自己设计或者给美工设计,定制强大。当然,脚本还是得自己写。pure参考文章:http://www.cnblogs.co...
阅读全文
摘要:public class BaseRepository:IBaseRepository where T : class { protected EfConnection DbContext = ContextFactory.GetCurrentContext(); ...
阅读全文
摘要:先从数据库开始,因为是用EF的code frist,所以所有的设计都在解决项目中进行。先是数据模型开始我已经建立了四个模型,user,role,action,actiongroupuser里面有role,role中的ActionIds存储action的id组合字符串,actiongroup作为act...
阅读全文
摘要:环境:EF6.0.0.0+Autofac3.5.0.0+MVC4.0+pure6.0+Jquery IDE:vs2012,数据库:vs2008r2搭建环境如下:我给它取名字为cactus:仙人球,我喜欢的一种植物。UML图如下(https://www.processon.com提供)360云分享项目...
阅读全文
摘要:直接上代码了public static List ToPagedList(this IEnumerable allItems, int pageIndex, int pageSize, Expression> keySelector) { var itemList...
阅读全文
摘要:1.IQueryable接口与IEnumberable接口的区别: IEnumerable 泛型类在调用自己的SKip 和 Take 等扩展方法之前数据就已经加载在本地内存里了,而IQueryable 是将Skip ,take 这些方法表达式翻译成T-SQL语句之后再向SQL服务器发送命令,它并不是...
阅读全文
摘要:1 ActionUrl c = new ActionUrl() { ActionName="test", RequestUrl="/123/123", SubTime=DateTime.Now }; 2 //增 3 using...
阅读全文
摘要:很多人用EF的默认链接工厂:System.Data.Entity.Infrastructure.LocalDbConnectionFactory然后我一开始就不习惯,然后研究了一下,截图如下然后就是public System.Data.Common.DbConnection CreateConnec...
阅读全文
摘要:本人建议玩code frist的人多用用System.ComponentModel.DataAnnotations和System.ComponentModel.DataAnnotations.Schema这个里面的特性来写实体类现在进入正题,怎么打破原先外键的命名规则呢[Table("sys_Use...
阅读全文
摘要:什么也不说先贴代码 --> 以上是我在配置是出的问题,我当时采用的是默认数据库连接测试在EF中我...
阅读全文