摘要:
1 public class HttpExtend 2 { 3 /// 4 /// 日志 5 /// 6 public static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 7 8 /// 9 /// post提交 Created By...
阅读全文
posted @ 2017-01-20 10:30
小小的菜鸟程序员
阅读(316)
推荐(0)
摘要:
1 public class Phone 2 { 3 /// 4 /// 日志 5 /// 6 public static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 7 8 9 public static readonly...
阅读全文
posted @ 2017-01-20 10:30
小小的菜鸟程序员
阅读(519)
推荐(0)
摘要:
1 public class EmailConfig 2 { 3 public static readonly string ServerAddress = ConfigurationManager.AppSettings["ServerAddress"]; 4 public static readonly string ServerUserName = Configuratio...
阅读全文
posted @ 2017-01-20 10:29
小小的菜鸟程序员
阅读(212)
推荐(0)
摘要:
1 public class ThreadExtend 2 { 3 public ThreadExtend() 4 { 5 } 6 7 /// 8 /// 线程对象 9 /// 10 protected System.Threading.Thread Th; 11 12 13 public System.Threading.Thread Th...
阅读全文
posted @ 2017-01-20 10:29
小小的菜鸟程序员
阅读(184)
推荐(0)
摘要:
1 /// 2 /// 在原来MemberHelper基础上修正了每次都初始化的问题,增加了对泛型的支持。改用静态构造函数来初始化 ZhangQC 2016.08.15 3 /// 4 public class MemcacheExtend 5 { 6 //日志 7 public static readonly ILog Log = LogManager.GetL...
阅读全文
posted @ 2017-01-20 10:28
小小的菜鸟程序员
阅读(163)
推荐(0)
摘要:
1 /// 2 /// json操作类 3 /// 4 public static class JsonExtend 5 { 6 /// 7 /// 对象转换为Json 8 /// 9 /// 10 /// 11 public static string ObjToJson(this object sender) 12 { 13 IsoDateTimeConvert...
阅读全文
posted @ 2017-01-20 10:27
小小的菜鸟程序员
阅读(217)
推荐(0)
摘要:
1 /// 2 /// 此类作用:数据仓库,数据基础操作 3 /// 4 /// 实体 5 /// 6 /// zhangqc 2016.08.08 新建 7 /// 8 public partial class Repository : IRepository, IDisposable 9 where TEntity : class 10 { 1...
阅读全文
posted @ 2017-01-20 10:27
小小的菜鸟程序员
阅读(626)
推荐(0)
摘要:
/// <summary> /// 此类作用:拦截所有经过IOC的方法,日志在Debug模式下记录传入参数,以及产生的错误 /// 日志在Release模式下,只有出错的情况下才会记录传入参数和错误信息 /// </summary> public class ExceptionLogBehavior
阅读全文
posted @ 2017-01-20 10:26
小小的菜鸟程序员
阅读(321)
推荐(0)
摘要:
1 /// 2 /// 此类作用:容器实体,使用App_Data\unity.config文件配置,根据XML配置初始化IOC Created by ZhangQC 2016.08.08 3 /// 4 public partial class IocFactory 5 { 6 /// 7 /// 依赖注入容器 8 /// 9 private sta...
阅读全文
posted @ 2017-01-20 10:26
小小的菜鸟程序员
阅读(395)
推荐(0)
摘要:
1 public class ImageDraw 2 { 3 public Image NewBitmap(int w, int h, float dpix, float dpiy) 4 { 5 var rt = new Bitmap(w, h); 6 rt.SetResolution(dpix, dpiy); 7 return rt; 8 } 9 10 ...
阅读全文
posted @ 2017-01-20 10:25
小小的菜鸟程序员
阅读(466)
推荐(0)
摘要:
1 /// 图像处理模式 2 /// 3 public enum ImageSizeMode 4 { 5 /// 原图,不做其他处理 6 /// 7 [CustomAttribute.Custom("原图", "N")] 8 None, 9 10 /// 居中 固定中心 剪裁或者留黑 11 /// 12 [CustomAttribute.C...
阅读全文
posted @ 2017-01-20 10:25
小小的菜鸟程序员
阅读(269)
推荐(0)
摘要:
1 /// 2 /// 执行Sql语句 3 /// 4 public static class DatabaseExtend 5 { 6 /// 7 /// 执行任何SQL语句,通用所有的数据库(SQLServer,MySql,Oracle等),利用EMIT快速反射,得到动态类型实体,支持参数查询,防止sql注入。 Created by ZhangQC 8...
阅读全文
posted @ 2017-01-20 10:22
小小的菜鸟程序员
阅读(1607)
推荐(0)
摘要:
1 /// 2 /// 实现动态排序 3 /// 来源博客园的一个大神,具体实现原理是利用实体和排序字段自动生成一个表达式 4 /// 再利用IQuerable的方法实现 5 /// 有一部分比较像微软的源码 ZhangQC 2016.10.20 6 /// 7 public static class DynamicOrder 8 { 9 #region ...
阅读全文
posted @ 2017-01-20 10:21
小小的菜鸟程序员
阅读(1943)
推荐(0)
摘要:
1 /// 2 /// 在数据仓储的情况下进一步封装数据库基础操作,此版本为异步版本 Created by ZhangQC 2016.08.17 3 /// 4 public static partial class EntityExtend 5 { 6 /// 7 /// 日志 8 /// 9 private static readonly ILog...
阅读全文
posted @ 2017-01-20 10:20
小小的菜鸟程序员
阅读(303)
推荐(0)
摘要:
1 /// 2 /// 本类用来将字符串转为可执行文本并执行 3 /// 做了一部分修改,修改原来的错误,修改,增加了部分逻辑。测试通过,请勿随意修改 ZhangQC 4 /// 5 public class Evaluator 6 { 7 #region 构造函数 8 /// 9 /// 可执行串的构造函数 10 /// 11 /// 12 ...
阅读全文
posted @ 2017-01-20 10:20
小小的菜鸟程序员
阅读(1997)
推荐(0)
摘要:
1 /// 2 /// 所有的枚举扩展 Created By ZhangQC 2016.08.19 3 /// 4 public static class EnumExtend 5 { 6 /// 7 /// 因为使用反射,频繁读取效率不高,故使用静态容器做缓存 Created By ZhangQC 2016.08.19 8 /// 9 private...
阅读全文
posted @ 2017-01-20 10:19
小小的菜鸟程序员
阅读(277)
推荐(0)
摘要:
1 /// 2 /// 自定义特性,比系统的display增加了一些参数 Created by ZhangQC 2015.08.19 3 /// 4 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, 5 AllowMultiple = false, Inherited = false)] 6 p...
阅读全文
posted @ 2017-01-20 10:18
小小的菜鸟程序员
阅读(187)
推荐(0)
摘要:
1 /// 2 /// 自定义比较器 ZhangQC 2016.11.29 3 /// 4 /// 5 /// 6 public class CommonEqualityComparer : IEqualityComparer 7 { 8 private readonly Func _keySelector; 9 10 public CommonEqualityCo...
阅读全文
posted @ 2017-01-20 10:17
小小的菜鸟程序员
阅读(221)
推荐(0)
摘要:
1 public static class CollectionExtend 2 { 3 /// 4 /// 向集合中添加元素 5 /// 6 /// 7 /// 8 /// 9 public static void Add(this IEnumerable collection, T value) 10 { 11 var list = collection as L...
阅读全文
posted @ 2017-01-20 10:15
小小的菜鸟程序员
阅读(1113)
推荐(0)
摘要:
1 public static class CloneExtend 2 { 3 /// 4 /// 深复制 5 /// 6 /// 7 /// 8 /// 9 public static T DepthClone(this T sender) 10 { 11 //先序列化 12 var objJson = sender.ObjToJson(); 13 //反序列化 1...
阅读全文
posted @ 2017-01-20 10:13
小小的菜鸟程序员
阅读(168)
推荐(0)
摘要:
1 /// 2 /// 此类作用:解决在同步方法中使用异步方法产生的线程死锁 3 /// 死锁的主要原因是因为代码中线程对上下文的争夺 4 /// 5 public static class AsyncExtend 6 { 7 /// 8 /// 同步执行一个void类型的返回值操作 9 /// 10 /// Task method to execu...
阅读全文
posted @ 2017-01-20 10:12
小小的菜鸟程序员
阅读(572)
推荐(0)
摘要:
1 /// 2 /// HttpRuntime Cache读取设置缓存信息封装 3 /// 使用描述:给缓存赋值使用HttpRuntimeCache.Set(key,value....)等参数(第三个参数可以传递文件的路径(HttpContext.Current.Server.MapPath())) 4 /// 读取缓存中的值使用JObject jObject=HttpRunt...
阅读全文
posted @ 2017-01-20 10:12
小小的菜鸟程序员
阅读(196)
推荐(0)