20 热度

RELEASE: ASP .NET Core 3.1 A-Z eBook

As promised, below is the initial release of the ASP .NET Core 3.1 A-Z ebook. This combines the 26 blog posts from the series of ASP .NET Core articles on this website...

收录时间: 2020-08-04
分类: ASP.NET Core
贡献者: Rector
17 热度

OpenTelemetry .NET Beta Released!

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.

收录时间: 2020-08-04
分类: .NET
贡献者: Rector
14 热度

Working efficiently with legacy database using Dapper

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.

收录时间: 2020-08-04
分类: .NET
贡献者: Rector
19 热度

AuthenticationStateProvider in Blazor WebAssembly

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.

收录时间: 2020-08-04
分类: Blazor
贡献者: Rector
12 热度

Cleaner tests with XUnit's IAsyncLifetime and expression-bodied members

When writing tests, sometimes it can be tempting to dump a bunch of asserts into the same test to avoid duplication across multiple tests...

收录时间: 2020-08-04
分类: .NET
贡献者: Rector
15 热度

XamarinCommunityToolkit: an introduction

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!

收录时间: 2020-08-04
分类: Xamarin
贡献者: Rector
AD 友情赞助
17 热度

Using the nameof C# keyword with ASP.NET 3 IUrlHelper

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.

收录时间: 2020-08-04
分类: ASP.NET Core
贡献者: Rector
16 热度

Creating a Progressive Web App with Blazor WebAssembly

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.

收录时间: 2020-08-04
分类: Blazor
贡献者: Rector
17 热度

.NET Core Console Apps - A Better Way?

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.

收录时间: 2020-08-04
分类: .NET Core
贡献者: Rector
15 热度

Integrating Cognitive Service Speech Recognition in .NET Core WPF applications

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

收录时间: 2020-08-03
分类: WPF
贡献者: Rector
29 热度

Show/Hide password using EventTrigger in Xamarin Forms

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.

收录时间: 2020-07-31
分类: Xamarin
贡献者: Rector
24 热度

How do I find which directory my .NET Core console application was started in or is running from?

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!

收录时间: 2020-07-31
分类: .NET Core
贡献者: Rector
29 热度

Learn about the latest .NET Productivity features

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.

收录时间: 2020-07-31
分类: .NET
贡献者: Rector
38 热度

DataGrip 2020.2 发布,多引擎数据库平台

DataGrip 2020.2 发布了,主要更新内容包括: Data editor 单元格值的单独编辑器 数据编辑器中的 DML 预览 布尔值获得新 UI 新的裁剪数据界面 在数据编辑器的上下文菜单中导出到剪贴板 [Mon...

收录时间: 2020-07-30
分类: 开发工具
贡献者: Rector
38 热度

ILSpy 6.1 发布,.NET 反编译工具

ILSppy 是一个开源的 .NET 反编译工具。目前,ILSpy 6.1 已发布,具体更新内容如下: New Language Features C# 9.0:Native ints C# 9.0:Attributes on local functions General ILSpy 现在...

收录时间: 2020-07-30
分类: 开发工具
贡献者: Rector
AD 友情赞助
34 热度

Despite .NET Core 3 Deprecation, Newtonsoft JSON Serializer Still Rules NuGet Roost

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.

收录时间: 2020-07-30
分类: .NET Core
贡献者: Rector
34 热度

JWT Auth in ASP.NET Core

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.

收录时间: 2020-07-30
分类: ASP.NET Core
贡献者: Rector
31 热度

Handling concurrency in an ASP.NET Core Web API with Dapper

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.

收录时间: 2020-07-30
分类: ASP.NET Core
贡献者: Rector
48 热度

.NET Core学习笔记(7)——Exception最佳实践

1.为什么不要给每个方法都写try catch为每个方法都编写try catch是错误的做法,理由如下:a.重复嵌套的try catch是无用的,多余的。这一点非常容易理解,下面的示例代码中,OutsideMethodA中的try catch是不起作用的...

收录时间: 2020-07-28
分类: .NET Core
贡献者: Rector
45 热度

File Upload with Blazor WebAssembly and ASP.NET Core Web API

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.

收录时间: 2020-07-28
分类: Blazor
贡献者: Rector
AD 友情赞助