摘要:
http://www.codeproject.com/Articles/1080517/Aspect-Oriented-Programming-using-Interceptors-wit Download sample application (or see the latest on Githu
阅读全文
posted @ 2016-06-20 18:42
shiningrise
阅读(340)
推荐(0)
摘要:
通过反射将变量值转为变量名本身 这是.NET反射的一个有趣小例子: 通过反射将变量值转为变量名本身. 当然要先添加命名空间:using System.Reflection; 示例代码如下: class Program { string name = "strA"; string strA = "st
阅读全文
posted @ 2016-06-20 16:51
shiningrise
阅读(517)
推荐(0)
摘要:
.NET 中获取调用方法名 在写记录日志功能时,需要记录日志调用方所在的模块名、命名空间名、类名以及方法名,想到使用的是反射(涉及到反射请注意性能),但具体是哪一块儿还不了解,于是搜索,整理如下: 需要添加相应的命名空间: using System; using System.Diagnostics
阅读全文
posted @ 2016-06-20 16:10
shiningrise
阅读(528)
推荐(0)
摘要:
https://github.com/aspnetboilerplate https://github.com/tangxuehua/enode daxnet的Apworks框架 http://www.cnblogs.com/mienreal/p/4340864.html https://githu
阅读全文
posted @ 2016-06-20 14:17
shiningrise
阅读(222)
推荐(0)
摘要:
http://cachemanager.net/Documentation/Index/cachemanager_architecture https://www.nuget.org/packages/CacheManager.Web/ https://github.com/MichaCo/Cach
阅读全文
posted @ 2016-06-19 21:56
shiningrise
阅读(323)
推荐(0)
摘要:
treeList.Sort((x, y) => x.SortIndex < y.SortIndex ? -1 : 0);
阅读全文
posted @ 2016-06-19 13:01
shiningrise
阅读(270)
推荐(0)
摘要:
You already created a database after running your Code-First application the first time, but what about the second time onwards?? Will it create a new
阅读全文
posted @ 2016-06-19 10:13
shiningrise
阅读(164)
推荐(0)
摘要:
git rebase -i HEAD~[number_of_commits] git rebase -i HEAD~2
阅读全文
posted @ 2016-06-18 17:58
shiningrise
阅读(164)
推荐(0)
摘要:
var databaseInitializer = new DatabaseInitializer(); databaseInitializer.MapperAssemblyFinder = new EntityMapperAssemblyFinder() { AllAssemblyFinder = new CanDoo.Core.Reflecti...
阅读全文
posted @ 2016-06-18 09:02
shiningrise
阅读(278)
推荐(0)
摘要:
Move the ApplicationUser definition to your DAL. Inherit your MyDbContext from IdentityDbContext<ApplicationUser> or IdentityDbContext OnModelCreating
阅读全文
posted @ 2016-06-18 03:20
shiningrise
阅读(1040)
推荐(0)
摘要:
public class CanDooDbContext : DbContextBase { protected override void OnModelCreating(DbModelBuilder modelBuilder) { if (modelBuilder == null) { ...
阅读全文
posted @ 2016-06-17 17:08
shiningrise
阅读(438)
推荐(0)
摘要:
VS2015 推荐插件///////////////////////////////////////////////////////////////////////////////////////////代码辅助及显示增强SuperCharger是原来的CodeMap在VS2013/VS2015上的
阅读全文
posted @ 2016-06-17 11:15
shiningrise
阅读(27784)
推荐(3)
摘要:
CREATE TABLE dbo.ELMAH_Error ( ErrorId UNIQUEIDENTIFIER NOT NULL, Application NVARCHAR(60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, Host NVARCHAR(50) COLLATE SQL_Latin1_G...
阅读全文
posted @ 2016-06-17 10:53
shiningrise
阅读(285)
推荐(0)
摘要:
上周码程序的时候碰到个问题,因为设计上的约束,一个方法接受的参数只能为List<object>类型,然而该方法需要处理的真实数据则是确定的List<Currency>。然而C#不允许显示的直接转换类型,并且两个方向上都不可以操作。这个问题让我爆了一会儿,最后在MSDN上找到了一个OfType<T>的
阅读全文
posted @ 2016-06-17 02:09
shiningrise
阅读(4053)
推荐(0)
摘要:
public static class ApiHelper { public static ReslultInfo Try(Action> action) { var r = new ReslultInfo(); try { action(r)...
阅读全文
posted @ 2016-06-15 20:38
shiningrise
阅读(656)
推荐(0)
摘要:
/// /// 测试获取所有物流 /// [TestMethod] public void TestExpressController() { var Expresss = new List { new Express{Code="01",Name="测试...
阅读全文
posted @ 2016-06-15 17:02
shiningrise
阅读(574)
推荐(0)
摘要:
Request Headers: User-Agent: FiddlerHost: localhost:3248Content-Type: application/json; charset=utf-8 Content-Length: 63 要加上Content-Type: application/
阅读全文
posted @ 2016-06-15 12:27
shiningrise
阅读(274)
推荐(0)
摘要:
我们在开发WEB项目的时候,一般应用逻辑跟ASPX页面是分离的项目。应用逻辑一般会是一个DLL组件项目。如果这个组件项目中A方法使用了Session、Cookie等信息的读写,则这个方法就很难写单元测试。 但并不是写不出来,要写出来大致思路如下: 目标: 构建一个测试的环境,把需要的Session、
阅读全文
posted @ 2016-06-15 09:50
shiningrise
阅读(830)
推荐(0)
摘要:
ASP.NET WebAPI 08 Message,HttpConfiguration,DependencyResolver Message WebAPI作为通信架构必定包含包含请求与响应两个方法上的报文,在WebAPI它们分别是HttpRequestMessage,HttpResponseMess
阅读全文
posted @ 2016-06-14 23:50
shiningrise
阅读(982)
推荐(0)
摘要:
不管你爱与不爱,单元测试对于一个软件的长治久安还是必不可少的一环。在Visual Studio 2012后,VS中的测试浏览器也能与第三方的集成了,用起来还是非常方便的。目前在.Net框架下的测试工具主要有Nunit、内置的MSTest以及Xunit这三个工具,本文就简单的介绍一下如何在VS中使用X
阅读全文
posted @ 2016-06-14 23:15
shiningrise
阅读(2181)
推荐(1)
摘要:
Entity Framework 延伸系列目录 今天我们来聊聊EF的日志记录. 一个好的数据库操作记录不仅仅可以帮你记录用户的操作, 更应该可以帮助你获得效率低下的语句来帮你提高运行效率 废话不多说,我们开始 环境和相关技术 本文采用的环境与技术 系统:WIN7 数据库:SQL Server2008
阅读全文
posted @ 2016-06-14 18:33
shiningrise
阅读(445)
推荐(0)
posted @ 2016-06-14 11:44
shiningrise
阅读(195)
推荐(0)
摘要:
- - - --> - + + --> + + + + -->
阅读全文
posted @ 2016-06-13 13:45
shiningrise
阅读(278)
推荐(0)
摘要:
IIS AppPool\jzzcj
阅读全文
posted @ 2016-06-13 09:22
shiningrise
阅读(149)
推荐(0)
摘要:
https://visualstudiogallery.msdn.microsoft.com/4934b087-e6cc-44dd-b992-a71f00a2a6df
阅读全文
posted @ 2016-06-12 23:37
shiningrise
阅读(465)
推荐(0)
摘要:
安装 nuget Microsoft.Net.Compilers
阅读全文
posted @ 2016-06-12 08:50
shiningrise
阅读(1263)
推荐(0)
摘要:
http://www.c-sharpcorner.com/blogs/dynamic-objects-conveting-into-data-table-in-c-sharp1
阅读全文
posted @ 2016-06-10 17:15
shiningrise
阅读(266)
推荐(0)
摘要:
https://developingsoftware.com/configuring-autofac-to-work-with-the-aspnet-identity-framework-in-mvc-5 Configuring Autofac to work with the ASP.NET Id
阅读全文
posted @ 2016-06-10 00:47
shiningrise
阅读(2781)
推荐(0)
摘要:
FineUI非常好用,但是有一个缺点,就是不支持dynamic对象的数据绑定。查了一下源代码,找了解决方案,其实只需要几行代码就可以搞定,这就是开源的好处。 本想直接在CodePlex上贡献代码,但不知道怎么加入项目,直接写在这儿吧,如果三石觉得有用,可以考虑合并在FineUI的下一个版本中。 这是ObjectUtil类的GetPropertyValue方法,加上4行代码,即可实现对dynam...
阅读全文
posted @ 2016-06-10 00:39
shiningrise
阅读(462)
推荐(1)
摘要:
http://www.cnblogs.com/John-Connor/archive/2012/05/03/2478821.html 引言-- 在初级篇中,我们介绍了如何利用基于ASP.NET MVC的Web程序中的Global文件来简单的重写路由。也介绍了它本身的局限性-依赖于路由信息中的键值对:
阅读全文
posted @ 2016-06-09 23:45
shiningrise
阅读(868)
推荐(1)
摘要:
using System; using System.Web; using System.Web.Routing; using Nop.Core; using Nop.Core.Data; using Nop.Core.Infrastructure; using Nop.Services.Events; using Nop.Services.Seo; using Nop.Web.Framewor...
阅读全文
posted @ 2016-06-09 23:39
shiningrise
阅读(355)
推荐(0)
摘要:
https://github.com/Azure/aspnet-redis-providers https://www.nuget.org/packages/Microsoft.Web.RedisSessionStateProvider/
阅读全文
posted @ 2016-06-09 20:00
shiningrise
阅读(1041)
推荐(0)
摘要:
http://www.xuebuyuan.com/356638.html 选择MiniProfiler.EF 默认会把MiniProfiler安装上,笔者程序是Asp.Net WebForm 不需要安装MiniProfiler.MVC3 2: 在Global.asax中添加下面代码: void Ap
阅读全文
posted @ 2016-06-09 19:49
shiningrise
阅读(678)
推荐(0)
摘要:
AutoMapper用法 AutoMapper是对象到对象的映射工具。在完成映射规则之后,AutoMapper可以将源对象转换为目标对象。 作者:齐飞 原文:http://www.qeefee.com/article/automapper 配置AutoMapper映射规则 AutoMapper是基于
阅读全文
posted @ 2016-06-09 18:04
shiningrise
阅读(274)
推荐(0)
摘要:
https://github.com/trailmax/IoCIdentitySample TL;DR: Registration code for Autofac, for SimpleInjector, for Unity. Tony Mackay has an alternative walk
阅读全文
posted @ 2016-06-09 17:44
shiningrise
阅读(1191)
推荐(0)
摘要:
/// /// Register dependencies /// /// Config protected virtual void RegisterDependencies(NopConfig config) { var builder = new ContainerB...
阅读全文
posted @ 2016-06-09 17:35
shiningrise
阅读(912)
推荐(0)
摘要:
http://stackoverflow.com/questions/6173566/run-time-registration-with-autofac Yes you can, using the Update method on ContainerBuilder: Autofac: canno
阅读全文
posted @ 2016-06-09 17:26
shiningrise
阅读(292)
推荐(0)
摘要:
http://www.cnblogs.com/smileberry/p/4047835.html
阅读全文
posted @ 2016-06-09 16:40
shiningrise
阅读(169)
推荐(0)
摘要:
http://www.codemaid.net/ http://www.codemaid.net/documentation/ http://www.wtoutiao.com/p/C9bNHv.html
阅读全文
posted @ 2016-06-09 14:15
shiningrise
阅读(194)
推荐(0)
摘要:
https://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970
阅读全文
posted @ 2016-06-09 13:32
shiningrise
阅读(280)
推荐(0)