Some time ago, we started to adapt the system to the new market that requires support for time zones. Initial research was described in the previous article. Now the approach has slightly evolved under the influence of realities. This article describes the problems encountered during the discussions and the final decision that is implemented.
I’d like to tell you straight off that this article will concern not threads in particular, but events in the context of threads in .NET. So, I won’t try arranging threads correctly (with all blocks, callbacks, canceling, etc.) There are many articles on this subject.
All examples are written in C# for the framework version 4.0 (in 4.6, everything is slightly easier, but still, there are many projects in 4.0). I will also try to stick to C# version 5.0.
Firstly, I’d like to note that there are ready delegates for the .Net event system that I highly recommend to use instead of inventing something new. For example, I frequently faced the following 2 methods for organizing events. (more…)
I have been working with WPF for about a year and some things annoying me very much. One of such things is converters. Why do I need to declare the implementation of a dubiously looking interface somewhere at the deep of a project and then search for it through CTRL + F by name when it is needed?
Well, it’s time to make a little easier on the routine of creating and using the converters. (more…)
When .Net Core was released, the old version of OData ASP.NET Web API turned out to be incompatible with the new platform. This fatal flaw allowed me to create my OData implementation on the .Net Core platform. After the creative rethinking of the previous implementation, I came to an understanding that it suffered from a complicated design with a lot of unnecessary abstractions. An idea to create an easy-to-use library that requires minimal coding came into my mind. I would like to present you OdataToEntity, the library for creating OData services without code writing; the only thing needed is data access context.
Assume you have products and categories. A client says that it is necessary to use other business processes for the categories with the rating value higher than 50. You have a solid experience and you understand that tomorrow this value may be different – 127.37. As you want to avoid this situation, you write the code in the following way:
Hangfire is a multi-threaded and scalable task scheduler built on client-server architecture on .NET stack (Task Parallel Library and Reflection) with the intermediate storage in a database. There is a free LGPL v3 version with open source. In this article, we are going to explore how to use Hangfire.
When adding or modifying a large number of records (10³ and more), the Entity Framework performance is far from perfect. The reasons are architectural peculiarities of the framework, and non-optimality of the generated SQL. Leaping ahead, I can reveal that saving data through a bypass of the context significantly minimizes the execution time. (more…)
Entity Framework 6 was and still remains a ‘workhorse’ for data access in corporate .NET-based applications primarily because of its stability, low barrier of entry and wide renown. Therefore, I hope this article will still be useful. (more…)
In the previous article, we have reviewed a general concept of implementing a minimum set of required modifications that include overriding the Object.Equals(Object) and Object.GetHashCode() methods in order to compare class objects by value on a standard .NET framework.
Let’s consider the implementation features of the Object.Equals(Object) method so that it meets the following documentation requirement:
x.Equals(y) returns the same value as y.Equals(x).
The string data type is one of the most significant data types in any programming language. You can hardly write a useful program without it. Nevertheless, many developers do not know certain aspects of this type. Therefore, let’s consider these aspects.
Representation of strings in memory
In .Net, strings are located according to the BSTR (Basic string or binary string) rule. This method of string data representation is used in COM (the word ‘basic’ originates from the Visual Basic programming language in which it was initially used). As we know, PWSZ (Pointer to Wide-character String, Zero-terminated) is used in C/C++ for representation of strings. With such location in memory, a null-terminated is located in the end of a string. This terminator allows to determine the end of the string. The string length in PWSZ is limited only by a volume of free space. (more…)