Pull to refresh
103.05

.NET *

A hub about .NET

Show first
Rating limit
Level of difficulty

Multithreading in Photon

Reading time8 min
Views1.1K

What this article is about 

In this article, we will talk about multithreading in the backend. 

how it is implemented 

how is it used 

what can be done 

what we invented ourselves 

All these questions are relevant only if you develop something for the server side - modify the Server SDK code, write your own plugin, or even start some server application from scratch.

Read More
Rating0
Comments0

One of the ways to dynamically deserialize a part of a JSON document with an unknown structure

Reading time7 min
Views14K

In this topic, I will tell you how to dynamically parse and deserialize only part of the whole JSON document. We will create an implementation for .NET Core with C# as a language.

For example, we have the next JSON as a data source for the report. Notice that we will get this JSON in the runtime and at the compile step we don't know the structure of this document. And what if you need to select only several fields for processing?

Read this amazing post
Total votes 2: ↑2 and ↓0+2
Comments1

Pitfalls in String Pool, or Another Reason to Think Twice Before Interning Instances of String Class in C#

Reading time10 min
Views2.1K

As software developers, we always want our software to work properly. We'll do everything to improve the software quality. To find the best solution, we are ready to use parallelizing or applying any various optimization techniques. One of these optimization techniques is the so-called string interning. It allows users to reduce memory usage. It also makes string comparison faster. However, everything is good in moderation. Interning at every turn is not worth it. Further, I'll show you how not to slip up with creating a hidden bottleneck in the form of the String.Intern method for your application.

Read more
Total votes 2: ↑1 and ↓10
Comments0

SmartTraits or lets add «multiple inheritance» to C#

Reading time13 min
Views1.5K


One of our clients, a developer who used to work with php technologies for quite some time, frequently complained that with the transition to C# and .Net stack, he misses one of his favorite features from the php world — traits and he would like it very much to be able to use such functionality in .Net.

At one point, we decided to make him a present and implemented a proof of concept of similar functionality for C#.

To our surprise, it was quite easy to implement the PoC and the process of development was a lot of fun.
Read more →
Rating0
Comments0

Compilation of math functions into Linq.Expression

Reading time12 min
Views5.6K

Here I am going to cover my own approach to compilation of mathematical functions into Linq.Expression. What we are going to have implemented at the end:

1. Arithmetical operations, trigonometry, and other numerical functions

2. Boolean algebra (logic), less/greater and other operators

3. Arbitrary types as the function's input, output, and those intermediate

Hope it's going to be interesting!

Read more →
Total votes 4: ↑4 and ↓0+4
Comments1

A little life hack when you work with Azure Service Bus and ASP.NET Core

Reading time7 min
Views12K

Some of the features of your website require message queue integration. It is not a complex task for most developers. If you work with Azure infrastructure, you are able to choose Azure Service Bus as a queue engine. It sounds quite simple: just create Azure Resource, write some code and then be happy! But what would you say if the resources are limited? What will you do if there are several teammates in your team, and all of you have to debug queues at the same time? I try to give you a simple solution.

Read more
Total votes 3: ↑3 and ↓0+3
Comments3

What Is yield and How Does It Work in C#?

Reading time21 min
Views2.1K

C# capabilities keep expanding from year to year. New features enrich software development. However, their advantages may not always be so obvious. For example, the good old yield. To some developers, especially beginners, it's like magic - inexplicable, but intriguing. This article shows how yield works and what this peculiar word hides. Have fun reading!

Read more
Total votes 2: ↑1 and ↓10
Comments0

A Spy Undercover: PVS-Studio to Check ILSpy Source Code

Reading time15 min
Views817

In PVS-Studio, we often check various compilers' code and post the results in our blog. Decompiler programs, however, seem to be a bit neglected. To restore justice in this world, we analyzed the ILSpy decompiler's source code. Let's take a look at the peculiar things PVS-Studio found.

Читать далее
Rating0
Comments0

C# Programmer, It's Time to Test Yourself and Find Error

Reading time2 min
Views1.2K

The PVS-Studio analyzer is regularly updated with new diagnostic rules. Curiously enough, diagnostics often detect suspicious code fragments before the end of the work. For example, such a situation may happen while testing on open-source projects. So, let's take a look at one of these interesting finding.

Read more
Rating0
Comments0

Top-10 Bugs Found in C# Projects in 2020

Reading time10 min
Views1.2K
image1.png

This tough year, 2020, will soon be over at last, which means it's time to look back at our accomplishments! Over the year, the PVS-Studio team has written quite a number of articles covering a large variety of bugs found in open-source projects with the help of PVS-Studio. This 2020 Top-10 list of bugs in C# projects presents the most interesting specimens. Enjoy the reading!
Read more →
Total votes 1: ↑0 and ↓1-1
Comments0

Rich text editors from backend perspective

Reading time7 min
Views4.4K
Welcome everyone, in this article I’m going to overview the most popular types of rich text editors, tradeoffs of their use from a backend perspective. By that I mean:

  • Streaming of content from the rich text editor to other infrastructure tools like full-text search, warehouses, etc.
  • Retrieving of content to clients: mobile, web, desktop.
  • Storing of content in some kind of storage (SQL database in my case)
  • Analyzing of content, which includes point 1, but also analyzing it from the perspective of our application
Read more →
Total votes 1: ↑0 and ↓1-1
Comments2

ONLYOFFICE Community Server: how bugs contribute to the emergence of security problems

Reading time12 min
Views920
image1.png

Server-side network applications rarely get the chance to join the ranks of our reviews of errors found in open source software. This is probably due to their popularity. After all, we try to pay attention to the projects that readers themselves offer us. At the same time, servers often perform very important functions, but their performance and benefits remain invisible to most users. So, by chance, the code of ONLYOFFICE Community Server was checked. It turned out to be a very fun review.
Read more →
Total votes 4: ↑3 and ↓1+2
Comments2

Development of “YaRyadom” (“I’mNear”) application under the control of Vk Mini Apps. Part 1 .Net Core

Reading time8 min
Views946
Application is developed in order to help people find their peers who share similar interests and to be able to spend some time doing what you like. The project is currently on the stage of beta-testing in the social network “VKontakte”. Right now I am in the process of fixing bugs and adding everything that is missing. I felt like I could use a bit of destruction and decided to write a little about the development. While I was writing, I decided to divide the text into different parts. Here we are going to pay more attention to backend nuances which I faced, and to everything that a user does not see.
Read more →
Rating0
Comments0

Analyzing the Code Quality of Microsoft's Open XML SDK

Reading time10 min
Views904
image1.png

My first encounter with Open XML SDK took place when I was looking for a library that I could use to create some accounting documents in Word. After more than 7 years of working with Word API, I wanted to try something new and easier-to-use. That's how I learned that Microsoft offered an alternative solution. As tradition has it, before our team adopts any program or library, we check them with the PVS-Studio analyzer.
Read more →
Total votes 5: ↑2 and ↓3-1
Comments1

Authors' contribution