Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use StackExchange in .net open source components

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use StackExchange in .net open source components, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Speaking of StackOverflow, a few words of gossip should be familiar to all programmers, especially for developers of. Net, which may be a well-known website that has not much left in. Net. With the departure of MySpace, some East has completely turned around, and even some second-rate IM, a former employer, turned to Java a long time ago. Feel to use. Net very good technical atmosphere of the company, in fact, the old employer's technical atmosphere is still good. There is a saying that. Net companies with a technical atmosphere have changed, and they think they have a good atmosphere if they insist on it. It is so black and beautiful that there is nothing to say about it. ). When I hear this later, I can slap him in the face with StackOverflow. Haha.

After repeated black and pink, as a. Net to live on. Net black to turn to the topic, these open source projects, the recommendations are related to. Net, and are in use on StackOverflow, you can rest assured to use boldly under appropriate circumstances.

1 、 dapper

Https://github.com/StackExchange/dapper-dot-net

There may be a lot of programmers have used, a mini ORM framework, very concise, just a cs file.

The core technology is called reflection emitting mechanism, the main idea is to generate IL dynamically at run time, and only in the first use, after that the use can run at full speed, the efficiency is very guaranteed. If you are interested, you can dig deeper, https://msdn.microsoft.com/zh-cn/library/8ffc3x75(v=vs.110).aspx.

The specific way of use is also very simple and convenient, send your own simple code and use notes.

Package code: https://github.com/fengzhbo/MySampleCode/blob/master/Code.Dapper/Code.Dapper/Main.cs (the code will be sent later, excuse me)

Simple notes: https://github.com/fengzhbo/MySampleCode/issues/1

The performance is very good, just take a look at the project introduction or test it yourself.

2 、 StackExchange.Redis

Https://github.com/StackExchange/StackExchange.Redis

A. Net client component that accesses the operation Redis.

Speaking of which, I have to mention another well-known Redis component, ServiceStack.Redis, which has been commercially licensed since 2.0. Https://servicestack.net/download#free-quotas, free of charge, uses only a maximum of 6000 requests per hour.

As a component of the client, there is still some difference in the use of the two, and the specific use is not introduced here. Or share your own simple packaging and usage notes.

Simple package: https://github.com/fengzhbo/MySampleCode/blob/master/Code.StackExchange_Redis/Code.StackExchange_Redis/Main.cs (code will be sent later, excuse me)

Simple notes: https://github.com/fengzhbo/MySampleCode/issues/2

3 、 MiniProfiler

Https://github.com/MiniProfiler

Https://github.com/MiniProfiler/dotnet

It is also used and maintained internally by StackOverflow, and it is a component that needs to be buried in the code to analyze performance.

After a general understanding, I think the tools that are still very useful, unlike other external tools from the inside of the code, the results will be more convincing. And there are big companies using it as endorsement, which is definitely worth using.

However, I have only learned that it has not been used in the actual project and can not be carried out. This is the only way to do it. I recommend it. If you have used it, you can discuss it in detail.

4 、 Opserver

Https://github.com/opserver/opserver

Stack Overflow's open source monitoring solution, released by Stack Exchange. It is built on the .NET Framework, which is a bit different in the field of monitoring tools. The aim is to provide a quick overall view of the health status of each monitored system, and to allow users to dig deep using drill-down methods.

Opserver is organized in the form of Web dashboards, each dedicated to a specific system. Opserver currently supports SQL Server, ElasticSearch, HAProxy, StackExchange.Exceptional, and Redis. Orion is a business tool from SolarWinds. Opserver also uses it to provide infrastructure and network monitoring. You don't need to use all of these systems for one Opserver installation, because they can be configured based on choice.

At this point, a simple data access layer skeleton based on open source components comes out: use Dapper for ORM;ProtoBuf.net serialization and deserialization, and finally use StackExchange.Redis to access Redis. Combined with these components, it is simple and convenient to use, high efficiency and good performance.

Net open source components on how to use StackExchange to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report