代码改变世界

随笔档案-2019年12月

Filters in ASP.NET Core

2019-12-17 09:42 by Dorisoy, 462 阅读, 收藏,
摘要: 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 阅读全文

.net core 从 ActionFilterAttribute 获取Request.Body 的正确方式

2019-12-17 09:37 by Dorisoy, 3173 阅读, 收藏,
摘要: 由于 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, 403 阅读, 收藏,
摘要: 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 阅读全文