50 热度

分布式唯一ID:雪花ID Snowflake .Net版

先抄个雪花ID介绍,雪花算法: 雪花算法的原始版本是scala版,用于生成分布式ID(纯数字,时间顺序),订单编号等。 自增ID:对于数据敏感场景不宜使用,且不适合于分布式场景。GUID:采用无意义字符串,数据量增大时造成访问过慢,且不宜排序。 算法描述: 最高位是符号位,始终为0,不可用。 41位 ...

收录时间: 2020-01-07
分类: .NET
贡献者: Rector
27 热度

Chaos Engineering your .NET applications using Simmy

Simmy is a fault-injection library that integrates with Polly, the popular .NET transient-fault-handling library. Its name comes from the Simian Army toolset, a suite of tools created by engineers at Netflix who recognised that designing a fault tolerant architecture wasn't enough - you have to exercise it, normalising failure to ensure your system can handle it when it inevitably happens.

收录时间: 2020-01-07
分类: .NET
贡献者: Rector
53 热度

MediatR 8.0 Released

MediatR 8.0 Released. This release brings some (minor) breaking changes to the public API. First, we added a non-generic overload to Send on IMediator...

收录时间: 2020-01-02
分类: .NET
贡献者: Rector
44 热度

Refactoring for Testability – A Christmas Miracle! (Guest Post)

For those who don’t know me, I’m that guy. You know the type; the ones who is super OCD about their code, stresses component-based architecture that encourages reuse, and who’s into Unit Testing. I think a lot of problems in the world could be solved if we all just practiced Test Driven Development.

收录时间: 2020-01-02
分类: .NET
贡献者: Rector
44 热度

New release of MyNatsClient - now 60% faster

Lately I've spent some time overhauling MyNatsClient (my open source .NET client for NATS). I've added support for TLS1.2 and fixed a few bugs but mostly been focusing on performance. And in doing so, I've managed to increase the performance with 60%.

收录时间: 2019-12-31
分类: .NET
贡献者: Rector
98 热度

.NET ORM 开源项目 FreeSql 1.0 正式版发布

FreeSql 是 .NET 平台下的对象关系映射技术(O/RM),支持 .NetCore 2.1+ 或 .NetFramework 4.0+ 或 Xamarin。从 0.0.1 发布,历时整整一年的迭代更新,原计划元旦发布1.0,可能作者比较急提前了几天发布。其实是元旦有其他事……本文内容从简,介绍项目的主要功能框架,以及暂时能想到的可能比较有说服力的特性。二、项目统计主仓库解决方案共计项目:29个单元测试:3510个Code Issues:168个文档Wiki:43个Stars:1140Forks:236Commits:690次Nuget主包下载量:86,568次开源地址...

收录时间: 2019-12-26
分类: .NET
贡献者: Rector
AD 友情赞助
55 热度

The ultimate guide to secure cookies with web.config in .NET

You've already heard about cross-site scripting (XSS), right? XSS is a situation where a hacker can inject malicious scripts into your website. This is not a blog post about XSS, but multiple bad things can happen if anyone succeeds in injecting code into your site. The one I want to present to you today is to take advantage of the cookies used by your site.

收录时间: 2019-12-26
分类: .NET
贡献者: Rector
46 热度

IdentityServer4学习笔记汇总(实现传送门在底部)

前言互联网时代,对信息和资源的保护越发苛刻,在所有应用中授权和认证是必不可少缺少的一部分。如果一个应用没有授权和认证那么这个应用就是不完整或者说不安全的应用。在.Net平台给我们提供了一套完整的授权认证框架,那就是IdentityServer4。它实现了OpenId Connect和OAuth2.0协议的认证授权。授权认证很多人喜欢把授权和认证混为一谈,但是其实授权(Authorization)和认证(Authentication)是有区别的。Authorization(授权) - 侧重点是用户能干嘛,而不关心用户是谁。Authentication(认证) - 侧重点是用户是谁,而不是用户能干...

收录时间: 2019-12-24
分类: .NET
贡献者: Rector
56 热度

Up Next: .NET 5

Now that Microsoft has shipped .NET Core 3.1, the next stop on the .NET Core roadmap is just plain old .NET 5 with no "Core" and no "Framework" -- it's all just .NET from here on.

收录时间: 2019-12-19
分类: .NET
贡献者: Rector
57 热度

刷新.NET

.NET Core 发布的那一天起,它在完成自我刷新的过程,一切为了适应未来,云原生。不仅仅跨平台那么简单。.NET Core 未来发展路线我们发现跳过了.NET Core 4.X 避免了和目前.NET Framework4.X命名上的混乱,明年直接命名为了.NET 5 , 默认还是core,不过.NET 4.8将是最后一个.NET Framework版本,.NET core 才是.NET真正的未来。.NET Core 是微软 .NET 技术的开源、跨平台版本,允许开发者在 Windows、Mac 和 Linux 上使用包括 C#、F#和 Visual Basic 等语言...

收录时间: 2019-12-18
分类: .NET
贡献者: Rector
48 热度

Assertion messages in tests

I received an interesting question from a fellow reader that I’d like to elaborate on:I have a question about Assert messages - should I use the overload that contains the message parameter and use it to pass a string describing why the Assert failed?The answer to this question comes down to two...

收录时间: 2019-12-18
分类: .NET
贡献者: Rector
103 热度

An Introduction to System.Threading.Channels

“Producer/consumer” problems are everywhere, in all facets of our lives. A line cook at a fast food restaurant, slicing tomatoes that are handed off to another cook to assemble a burger, which is handed off to a register worker to fulfill your order, which you happily gobble down. Postal drivers delivering mail all along their routes, and you either seeing a truck arrive and going out to the mailbox to retrieve your deliveries or just checking later in the day when you get home from work.

收录时间: 2019-12-13
分类: .NET
贡献者: Rector
38 热度

.NET Framework 发布 12 月安全性和质量汇总

.NET Framework 的 2019 年 12 月安全和质量汇总更新现已发布。 据悉,此版本包含以下质量和可靠性方面的改进: ASP.NET 现如今,当 HttpCookie.SameSite 值为 “ None” 时,ASP.NET 将发出...

收录时间: 2019-12-12
分类: .NET
贡献者: Rector
54 热度

.NET Framework December 2019 Security and Quality Rollup

Today, we are releasing the December 2019 Security and Quality Rollup Updates for .NET Framework.

收录时间: 2019-12-12
分类: .NET
贡献者: Rector
58 热度

dotnet 单元测试注入文件读写

单元测试文件读写的难点是构建出测试的文件,如要求文件的权限是用户不可读,如要求文件的长度很长,如要求文件的修改时间。而 System.IO.Abstractions 这个库提供了注入抽象的文件,所有属性都可以设置。首先安装 System.IO.Abstractions 库,这个库提供了 IFileSystem 接口,使用这个接口提供的文件读写方法代替静态类 File 等方法。这样通过注入 IFileSystem 接口,可以进行文件读写测试Install-Package System.IO.Abstractions在使用 System.IO.Abstractions 库进行注入,需要对代码进行一些...

收录时间: 2019-12-11
分类: .NET
贡献者: Rector
AD 友情赞助
60 热度

How to simulate AutoMapper that works during the build time

Almost two years ago I created the very first version of MappingGenerator. Since then, I’ve put a lot of work in this project, adding new functions and improving the mapping generation algorithm with 14 releases (43 issues/feature requests closed) in the meantime. With over 5.5k downloads from the marketplace and 380 stars on Github, it looks like there is quite a market demand for this kind of tool...

收录时间: 2019-12-10
分类: .NET
贡献者: Rector
64 热度

Why is reflection slow? · Performance is a Feature!

It’s common knowledge that reflection in .NET is slow, but why is that the case? This post aims to figure that out by looking at what reflection does under-the-hood...

收录时间: 2019-12-10
分类: .NET
贡献者: Rector
60 热度

November 2019 .NET/ASP.NET Documentation Update

So the .NET Core 3.1 has finally released in the last few days, so expect lots of things related to this. This update covers everything that happened since November 1st through December 4th. Although not everything has yet been updated for 3.1, expect a lot more coming next month! If you still don’t know me, my name is Maxime Rouiller and I’m a Cloud Advocate with Microsoft. For this month, I’m covering three major products...

收录时间: 2019-12-07
分类: .NET
贡献者: Rector
73 热度

Using WebAssembly from .NET with Wasmtime

Wasmtime, the WebAssembly runtime from the Bytecode Alliance, recently added an early preview of an API for .NET Core, Microsoft’s free, open-source, and cross-platform application runtime. This API enables developers to programmatically load and execute WebAssembly code directly from their .NET programs.

收录时间: 2019-12-06
分类: .NET
贡献者: Rector
73 热度

.NET高级特性-Emit(2.1)字段

在上篇blog写完的几天后,有读者反映写的过于复杂,导致无法有效的进行实践;博主在考虑到园子里程序员水平高低不一致的情况,所以打算放慢脚步,对类的一些内容进行详细的讲解,顺带的会写一些笔者所遇到过的Emit的坑以及如何使用Emit来为我们的工作减负,毕竟,知识用到实践当中才有其因有的价值。博主在文末也会将样例上传github,方便大家实践。首先,照例我先把我之前写的博文链接上来,方便大家阅读《.NET高级特性-Emit(1)》《.NET高级特性-Emit(2)类的定义》一、什么是字段   有很多读者会说,我在项目当中基本上没怎么用到字段啊,基本上都是用C#的属性居多,两者不是都能存储数据吗,你...

收录时间: 2019-11-30
分类: .NET
贡献者: Rector
AD 友情赞助