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.
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.
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…)
During the development of reporting forms, a user wanted to see the process of data loading from the database. He wanted the timer to start running after hitting the button, and as strings were received, their number was displayed on the form. I needed to implement this within an existing ASP.NET project. (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.
In this article, I am going to provide you with a working solution that allows you to have a single dependency container (IoC container) during the whole query life cycle, as well as to control its creation and disposal.
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:
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.
I write this tutorial primarily to demonstrate how to quickly create a simple application with support for npm, Webpack, and TypeScript based on an initial ASP.NET Core application template (which will run debugging from Visual Studio).
When I was programming in C#, I used to send all recursive tasks to an unmanaged C code, since the .NET performance was problematic. And now, looking back at my past experience, I think of the benefits of such code division. Do I really benefit from it, and if yes, how much? What is the best way of building API with such approach? (more…)