Swashbuckle (Swagger) Customization for WebAPI

Who has ever tested their WebAPI knows such tools as Postman or Advanced REST (extensions for Chrome). These tools are convenient in every way, except that they are not able to recognize which models the API accepts, which ones it returns and do not provide information about all possible endpoints. The Swashbuckle package solves this disadvantage. It builds Swagger specification generation and UI in the project. In this article, I will briefly describe how to bind it to the project and provide some details about authorization and work with “overloaded” endpoints.

Read More

DateTime to DateTimeOffset Transition

Imagine that you want to convert your system from one state to another. The initial state is when DateTime is used everywhere, both in C# code and in the database. The final state is when DateTimeOffset is used everywhere. You want to make the transition smooth and make as few changes as possible. This description can be the beginning of a very interesting problem with a dead end at the end.

Read More

Simplifying Converters for WPF

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. Read More

OdataToEntity – an easy way to create .Net Core OData services

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.

Read More

ASP.NET Core MVC: Feature Folders

The first version of ASP.NET MVC appeared back in 2009, and the platform (ASP.NET Core) was first relaunched last summer. During this time, the default project structure has remained almost unchanged: folders for controllers, views, and often for models (or perhaps ViewModels). This approach is called Tech folders. After creating a new ASP.NET Core MVC project, the organization structure of folders is the following:

Read More

Type Conversion in .NET


Such a simple topic as type conversion would seem to be unworthy of the whole article. In C#, there is a suitable operator “(T)value” and types that implement it. So, this topic may be considered as closed. However, for 14 years of .NET existence, BCL developers and other programmers have come up with other four ways to convert value types.

Read More