随笔分类 - C#
摘要:Web.Release.config 和 Web.Debug.config
阅读全文
摘要:前台页面中,model转json: json失败&&session获取失败&&登陆超时
阅读全文
摘要:避免一个接口一个方法 接口太多,难以维护 需要以服务为边界,不要以数据库模型来定义边界 对于给出提示的废弃的方法,不要使用,应找出替代方法 不要使用using (var context = new FileManagerEntities()) 无法mock数据,不易单元测试 应从工厂中取数据 赋值优化 CopyTo() 类的继承 避免硬编码,多用抽象的方法、服务来实现 异常处理,...
阅读全文
摘要:private int LevenshteinDistance(string s1,string s2,int maxValue) { if (s1 == null|| s1.Length == 0) return maxValue; if (s2 == null|| s2.Length == 0) return m...
阅读全文
摘要:public enum BackTracking { UP, LEFT, NEITHER, UP_AND_LEFT } public abstract class LCSBaseMatch { /// /// 设置连续字符的匹配值 /// ...
阅读全文
摘要:相关文章 NLog文章系列——系列文章目录以及简要介绍 Elasticsearch,Kibana,Logstash,NLog实现ASP.NET Core 分布式日志系统 ElasticSearch+NLog+Elmah实现Asp.Net分布式日志管理 NLog NLog:官网 & Nuget简介 N
阅读全文
摘要:产生原因: model类添加了 [System.Serializable] 解决方案: xxxxx.WebApi\App_Start\WebApiConfig.cs的Register函数中添加如下代码
阅读全文
摘要:Simple Injection:所有实现依赖于抽象 Repository Pattern:位于领域层与数据访问层之间。 EF之Code First:数据库交互 Moq:单元测试框架,文档 WebApi:特点 1. 自动生成说明文档 2.注重数据,不用对每个请求设置view,自动返回json、xml
阅读全文
摘要:缺点: 不能使用request( HttpContext.Current.Request),request属于主线程,不能跨线程调用 task系列文章 task示例详解
阅读全文
摘要:原文地址 ctrl是强制功能键,shift有给项目增加功能作用 1、 窗口快捷键 : window Ctrl+W,W: 浏览器窗口 (window shopping ) Ctrl+W,S: 解决方案管理器 (Solution) Ctrl+W,C: 类视图 (Class) Ctrl+W,E: 错误列表
阅读全文
摘要:Entity Framework 映射 1.逻辑层:定义关系数据 SSDL:store schema definition language,存储架构定义语言 2.概念层:定义.NET类 CSDL:conceptual schema difinition language,概念架构定义语言 3.映射
阅读全文
摘要:转载自 http://csharpindepth.com/Articles/Chapter12/Random.aspx 相关博文推荐 http://blog.csdn.net/chenyujing1234/article/details/7695020 msdn解释 https://msdn.mic
阅读全文
摘要:benifit: 1.make developers extremely productive is code reuse, which is the ability to derive a class that inherits all of the capabilities of a base
阅读全文
摘要:1.A type that defines an event member allows the type (or instances of the type) to notify other objects that something special has happened 2.definin
阅读全文
摘要:4.Operator Overload Methods allow a type to define how operators should manipulate instances of the type. 1.The CLR doesn’t know anything about operat
阅读全文
摘要:1.Instance Constructors and Classes (Reference Types) Constructors methods : 1.allow an instance of a type to be initialized to a good state. 2.are al
阅读全文
摘要:The common language runtime (CLR) offers two kinds of properties: 1.parameterless properties, which are simply called properties 2.parameterful proper
阅读全文