摘要:
Filters in ASP.NET Core allow code to be run before or after specific stages in the request processing pipeline. Built-in filters handle tasks such as 阅读全文
随笔分类 - ASP.NET MVC
.net core 从 ActionFilterAttribute 获取Request.Body 的正确方式
2019-12-17 09:37 by Dorisoy, 3187 阅读, 收藏,
摘要:
由于 ModelBinding在动作过滤器之前运行,直接使用 context.ActionArguments["parameter"] 获取模型对象 This article shows how to use an ActionFilter to validate the model from a 阅读全文
Getting A Mime Type From A File Name In .NET Core
2019-12-16 13:25 by Dorisoy, 412 阅读, 收藏,
摘要:
Getting a mime type based on a file name (Or file extension), is one of those weird things you never really think about until you really, really need 阅读全文
Using the Repository and Unit Of Work Pattern in .net core
2019-10-27 16:25 by Dorisoy, 827 阅读, 收藏,
摘要:
A typical software application will invariably need to access some kind of data store in order to carry typical CRUD (Create, Read Update, Delete) ope 阅读全文
构建 Owin 中间件 来获取客户端IP地址
2017-11-21 13:47 by Dorisoy, 1128 阅读, 收藏,
摘要:
Not so long ago, we discussed on this blog the possible ways of retrieving the client’s IP address in ASP.NET Web API. With the latest changes in the 阅读全文
SignalR WebSocket Error during WebSocket handshake: net::ERR_CONNECTION_RESET
2017-09-12 09:27 by Dorisoy, 7048 阅读, 收藏,
摘要:
system.web 节点添加: <httpRuntime maxRequestLength="104857600" executionTimeout="1200" targetFramework="4.5" requestValidationMode="2.0" /> 阅读全文
EF There is already an open DataReader associated with this Command
2017-09-05 16:00 by Dorisoy, 1532 阅读, 收藏,
摘要:
捕捉到 System.InvalidOperationException _HResult=-2146233079 _message=意外的连接状态。在使用包装提供程序时,请确保在已包装的 DbConnection 上实现 StateChange 事件。 HResult=-2146233079 解决 阅读全文
MVC5 您不能调用控制器“xx”上的操作方法“xx”,因为该方法是一种泛型方法
2017-07-13 08:56 by Dorisoy, 1163 阅读, 收藏,
摘要:
在 MVC5 中当使用 routes.MapMvcAttributeRoutes() 添加路由属性是导致在控制器创建的泛型方法调用错误: Cannot call action method 'System.Collections.Generic.IEnumerable1[System.Web.Mvc 阅读全文
Geckofx 45 正确模拟键盘输入的事件绑定方法
2017-04-26 14:10 by Dorisoy, 1795 阅读, 收藏,
摘要:
var inputs = selection.GetElementsByTagName("input").Select(p => p as Gecko.DOM.GeckoInputElement).Where(p => p.GetAttribute("placeholder") == "Stake"); foreach (var inp... 阅读全文
Code-Based Configuration (EF6 onwards)
2016-06-01 09:55 by Dorisoy, 247 阅读, 收藏,
摘要:
https://msdn.microsoft.com/en-us/data/jj680699#Using 阅读全文
AutoFac使用方法总结:Part III
2016-04-21 09:58 by Dorisoy, 234 阅读, 收藏,
摘要:
生命周期 AutoFac中的生命周期概念非常重要,AutoFac也提供了强大的生命周期管理的能力。 AutoFac定义了三种生命周期: Per Dependency为默认的生命周期,也被称为’transient’或’factory’,其实就是每次请求都创建一个新的对象 [Fact] public v 阅读全文
AutoFac使用方法总结:Part II
2016-04-21 09:56 by Dorisoy, 270 阅读, 收藏,
摘要:
事件 AutoFac支持三种事件:OnActivating,OnActivated,OnRelease。OnActivating在注册组件使用之前会被调用,此时可以替换实现类或者进行一些其他的初始化工作,OnActivated在实例化之后会被调用,OnRelease在组件释放之后会被调用。 publ 阅读全文
AutoFac使用方法总结:Part I
2016-04-21 09:54 by Dorisoy, 288 阅读, 收藏,
摘要:
注册部分 使用RegisterType进行注册 [Fact] public void can_resolve_myclass() { var builder = new ContainerBuilder(); builder.RegisterType<MyClass>(); IContainer c 阅读全文
Attribute Routing in ASP.NET MVC 5
2016-04-05 11:31 by Dorisoy, 176 阅读, 收藏,
摘要:
Attribute Routing in ASP.NET MVC 5 阅读全文
Attribute Routing in ASP.NET Web API 2
2016-04-05 11:30 by Dorisoy, 188 阅读, 收藏,
摘要:
Attribute Routing in ASP.NET Web API 2 阅读全文
实体框架 5 性能注意事项
2015-06-24 13:17 by Dorisoy, 393 阅读, 收藏,
摘要:
1.简介对象关系映射框架是一种在面向对象的应用程序中提供数据访问抽象的便捷方式。对于 .NET 应用程序,Microsoft 推荐的 O/RM 是实体框架。但任何抽象都要考虑性能。本白皮书旨在介绍在使用实体框架开发应用程序时的性能注意事项,使开发人员了解能够影响性能的实体框架内部算法,以及提供有关进... 阅读全文
ASP.NET执行循序
2015-06-08 08:28 by Dorisoy, 224 阅读, 收藏,
摘要:
首先第一次运行一个应用程序(WebSite或者WebApplication都是Web应用程序)第一次请求 ->1,IIS ->2,aspnet_isapi(非托管dll) ->3,HttpRuntime(到这里已经是托管的了)HttpRuntime中只有一个方法ProcessRequest 这个方法... 阅读全文
浙公网安备 33010602011771号