49 热度

Encrypting and Decrypting a String in C#

In this article, we will learn how encrypting and decrypting a string is done using C# and the Cryptography package that comes included with .NET.

收录时间: 2023-01-17
分类: C#
贡献者: Rector
43 热度

Generic Attributes in C#

In this article, we are going to learn how generic attributes help us implement better custom attributes through a practical example.

收录时间: 2023-01-12
分类: C#
贡献者: Rector
39 热度

How to Iterate Over JSON Objects in C#

Manipulating JSON objects is a common operation in applications. In this article, we will look at different ways of iterating over JSON objects in C#.

收录时间: 2023-01-12
分类: C#
贡献者: Rector
54 热度

ConcurrentBag in C#

In C#, there are many classes that we can use to represent a group of objects that we may manipulate concurrently using multiple threads. One such class is the ConcurrentBag. In this article, we will learn how to add, access, and remove elements from a ConcurrentBag in C#. Then, we will discuss the advantages and disadvantages of this collection type.

收录时间: 2023-01-05
分类: C#
贡献者: Rector
55 热度

Understanding Task and ValueTask in C#

If we want to optimize our code and improve the performance of our app, there is no one go-to solution. Instead, we analyze our code and try to find where to improve. Understanding Task and ValueTask in C# is essential because using them correctly significantly enhances our app’s performance. In this article, we will try to understand what Task and ValueTask are and when to choose one over the other.

收录时间: 2023-01-05
分类: C#
贡献者: Rector
44 热度

IEnumerable in C#

In this article, we are going to learn about IEnumerable in C#. IEnumerable acts as an abstraction over a collection and allows us to iterate over it without knowing the actual type of the collection.

收录时间: 2022-12-29
分类: C#
贡献者: Rector
AD 友情赞助
97 热度

Introducing C# 11: Required properties

C# 11 improves the initialization of objects and struct. Marking one or more properties as mandatory on initialization is now possible and will help you not to forget to initialize your properties correctly. In this post I will show you how it works with the object initializer syntax and the object instantiation with a constructor.

收录时间: 2022-12-03
分类: C#
贡献者: Rector
96 热度

Introducing C#11: Raw string literals

C# 11 brings new syntax for writing plain text. Instead of relying on string interpolation with the character $ and the verbatim with @ character for writting on several lines, C# 11 allows using three double quotes. There is no need to double the quotes in the text to escape a double quote anymore. In this post, I will show you a simple example of it!

收录时间: 2022-11-30
分类: C#
贡献者: Rector
100 热度

Floating-Point Types in C# - Double vs Float vs Decimal

In this article, we are going to cover floating-point types in C#. Our focus will be mainly on Double, Float and Decimal data types. We have covered the basic data types extensively, and you can check out this article if you feel the need to brush up on the basics.

收录时间: 2022-11-30
分类: C#
贡献者: Rector
100 热度

C# String Interpolation

Very early in the history of programming, we’ve seen the need to use text on a machine that works with numbers. Over many decades we devised many different ways to construct and analyze text for better understanding by both humans and machines. String interpolation, in the way that C# offers it, is the most elegant and readable way to construct text messages we’ve seen so far.

收录时间: 2022-11-29
分类: C#
贡献者: Rector
98 热度

How to Check if a String Ends With a Number in C#

Checking if a string ends with a number in C# is a very common operation. In this article, we are going to show various ways in which we can do this. 

收录时间: 2022-11-27
分类: C#
贡献者: Rector
139 热度

SortedSet in C#

A SortedSet in C# is a data structure that allows us to store and access elements in sorted order. In this article, we are going to explore how to create and use the SortedSet class in C#. We are also going to look at some of the benefits and drawbacks of using this data structure. Finally, the article concludes with tips on taking advantage of the C# SortedSet in our applications.

收录时间: 2022-11-10
分类: C#
贡献者: Rector
143 热度

Welcome to C# 11

I am excited to announce that C# 11 is out! As always, C# opens some entirely new fronts, even while advancing several themes that have been in motion over past releases. There are many features and many details, which are beautifully covered under What’s new in C# 11 on our docs pages. What follows here is an appetizer of some of the highlights – small and big.

收录时间: 2022-11-09
分类: C#
贡献者: Rector
117 热度

How to Use HTML Agility Pack in C#

In this article, we’re going to learn how to use HTML Agility Pack in C# and review some examples of its most important features.

收录时间: 2022-11-09
分类: C#
贡献者: Rector
130 热度

Tasks vs Threads in C#

In this article, we are going to look at the main differences between Tasks and Threads. They are both used for concurrent programming, but Tasks were later introduced with .NET Framework 4.

收录时间: 2022-11-09
分类: C#
贡献者: Rector
AD 友情赞助
132 热度

Concurrent Collections in C#

Concurrent Collections in C# are a set of collections designed for synchronized multi-thread access. We can find concurrent collections under the System.Collections.Concurrent namespace. Nowadays, where it is getting increasingly important and accessible to work in a multi-threaded environment, concurrent collections are essential. .NET provides a set of concurrent collections. In this article, we will try to understand what concurrent collections are, the collections that have thread-safe variants, and the constraints of concurrent collections.

收录时间: 2022-11-04
分类: C#
贡献者: Rector
120 热度

HashSet in C#

In this article, we are going to take a look at the HashSet class in C#. We will discuss how to use it and its key features. Also, we are going to see some examples of how to use it in practice. Finally, we’ll compare it to other data structures available in C#.

收录时间: 2022-11-04
分类: C#
贡献者: Rector
130 热度

Advanced LINQ

LINQ is an extremely useful library with many applications. These applications are not all utilized or understood equally. In this article, we are going to take a look at some advanced LINQ capabilities to perform grouping, joining, partitioning, and even converting object types.

收录时间: 2022-11-01
分类: C#
贡献者: Rector
157 热度

Dictionary vs Hashtable in C#

In this article, we are going to compare Dictionary and Hashtable in C#. We will start with a brief introduction to both data structures and then proceed to the comparison.

收录时间: 2022-10-28
分类: C#
贡献者: Rector
175 热度

Common C# Programming Mistakes

In this article, we are going to look at some common C# programming mistakes. We are pretty sure that there are a lot more mistakes that developers make while writing their projects, but here, we will try to summarize the ones we often noticed while working with other developers.

收录时间: 2022-10-20
分类: C#
贡献者: Rector
AD 友情赞助