Today, we are happy to announce that the OpenTelemetry .NET SDK has reached beta. This means that you can now begin integrating the OpenTelemetry .NET SDK into your applications and libraries to capture and export metrics and traces.
A year ago I started working on a set of projects that requires accessing data from a huge legacy database. There was a decision to use Dapper to facilitate database access code. For those of you who are not familiar with Dapper, it’s a set of extension methods to IDbConnection, which allows to easily map C# object to SQL query parameters, as well as SQL query result to C# objects. I was quite skeptical to use a library that requires writing SQL queries directly in the C# code, because I got used to relying always on ORMs (NHibernate in particular). Throughout the year, Dapper has proven to be the right tool for the job. In the meantime, I also discovered a couple of features and tricks that allow me to write quite concise and easy to maintain database access code, and I think it’s worth sharing them here.
After all the knowledge, we have been collecting during this series, it is time to learn about authentication and authorization in Blazor WebAssembly. In this article, we are going to explore how to accomplish these actions by inspecting the AuthenticationStateProvider. We are going to create a test AuthenticationStateProvider to inspect how it works and how to protect our components. Furthermore, we are going to hide UI from unauthorized users and read the authentication state in the C# code. Later on in the series, we are going to replace the test one with the real AuthenticationStateProvider class.
When writing tests, sometimes it can be tempting to dump a bunch of asserts into the same test to avoid duplication across multiple tests...
Today I can proudly introduce to you the XamarinCommunityToolkit package! In this post you will read all about this package (also known as XamarinCommunityToolkit). What it does, my vision for it and how you can use it, today!
I recently spent a couple of hours yak-shaving, and despite much Googling couldn't find any help on the internet. I'm surprised that the following problem turned out to be so difficult to figure out, so it may just be that I'm ignorant or that my web search skills failed me that day. On the other hand, if this really is as difficult as I found it, perhaps this article can save some other poor soul an hour or two.
When people talk about a Progressive Web App (PWA) they typically refer to an app that can (a) run in the browser but (b) can also function as a desktop app, even in (c) offline mode, and do that while (d) looking as much like a native app as possible. Blazor WebAssembly (formerly Client Side Blazor) makes creating a running PWA that hits most of those marks relatively easy. But, of course, just creating something that runs isn't enough: You have to create something useful which, if you want to support running offline, can be ... challenging.
I was at a customer site last week and a lot of their integration code is a set of console apps that are run on timers to import and export data. This isn't an uncommon use-case. I've got a couple of these lying around myself. I realized that I didn't know of a good exemplar of doing simple console apps using .NET Core in a way that is closer to ASP.NET Core (e.g. dependency injection, lifetime management, cancellation, etc.). So I decided to re-write an old console app I have.
Some times ago we talked about how to integrate the Cognitive Service Speech Service in UWP apps. Now, let’s see how to use the same service in a .NET Core WPF application. In the original article, we shown how to use the UWP MediaCapture APIs to check the availability of the microphone. Thanks to the Microsoft.Windows.SDK.Contracts NuGet package, we can use the same APIs also from .NET Framework 4.6+ and .NET Core 3.0+ platforms...
A common requirement in mobile applications is the ability to show/hide a password field. Googling I discovered that there are many ways to do it, some people create a custom control, others prefer to use a custom renderer, effects, etc. In this post, I want to show you a very simple way to achieve this by using EventTrigger.
I got a great question emailed to me today. And while I could find the answer and email them back, I also have a limited number of keystrokes. Plus, every question that moves knowledge forward is a gift, and I don't want to ignore a gift. So instead, I've email my new friend a link to this blog!
The .NET Productivity team (a.k.a. Roslyn) is constantly thinking of new ways to make .NET developers more productive. We’ve been working hard to take the feedback you’ve sent us and turn it into tools that you want! In this post, I’ll cover some of the latest .NET productivity features available in Visual Studio 2019.
Despite being deprecated by Microsoft in .NET Core 3.0, the wildly popular Newtonsoft.Json JSON serializer still rules the roost in the NuGet package manager system for .NET developers.
In this article, I will show you how to implement an ASP.NET Core web API application using JWT authentication and authorization. This web API application implements processes such as login, logout, refresh token, impersonation, and so on. The following screenshot shows the API endpoints that we are going to walk through in this article.
In this post, we will cover how to handle concurrency for a resource in an ASP.NET Core Web API. The endpoint we will focus on is updating a product resource. The product lives in a SQL Server database and we access it with Dapper. We will handle the case when requests are trying to update the product at the same time.
In the previous article, we have created a form where we had to manually type the image URL. But of course, this is not a solution we are aiming for. In this article, we are going to modify that and learn about file upload with Blazor WebAssembly. But let’s go step by step. We are going to add the server logic first and then we are going to implement the client-side upload functionality.