Practical .NET


.NET Core: Writing Really Obvious Code with Enumerated Values in gRPC Web Services

Peter's pretty fanatical about replacing documentation/comments with readable code. So he's very excited about using enums when defining gRPC services. Very. Excited. But there are some best practices and "things to be aware of" when using this feature.

How to Design Messages for gRPC Services in .NET Core

Defining your gRPC service using the Protocol Buffers specification is pretty easy. There are just a couple of things to be aware of as you convert from the specification to .NET Core and then manage your service's evolution.

Sign

Working with Claims to Authorize Users in ASP.NET Core and Blazor

When you need to integrate authorizing the user to perform some activity (or just want to retrieve information about the current user), you need to work with the ClaimsPrincipal’s Claims objects. Here’s everything you might want to do.

Floating White Boxes Graphic

Accessing and Extending Authorization Claims in ASP.NET Core and Blazor

When you need to integrate authorization with procedural code, you're going to need your application's ClaimsPrincipal object so that you can check the user's authorization claims. Here's both how to get to the ClaimsPrincipal and how to extend it with custom claims.

Declarative Claims-Based Authentication in ASP.NET Core 3.0

While security in ASP.NET Core is wholly claims based, you can still use the Authorize attribute to control access to your application. You just need to set up the right policies to work with the claims associated with the current user.

Black White Wave IMage

How to Authorize Users in Blazor Declaratively

When it comes to controlling which users can access which functionality in a Blazor application you not only have access to all of the user’s authentication you can authorize the user’s actions without writing any code.

Writing the Code for a gRPC Service and Client in ASP.NET Core 3.0

Once you've got a contract that describes a gRPC service, creating the service itself and a client that can call the service is easy. In fact, Visual Studio will do most of the work for you ... once you've got your projects set up correctly, that is.

Defining Your First gRPC Service in an ASP.NET Core 3.0 Project

gRPC services promise a lot: better performance, more sophisticated messaging, and a contract-based approach to Web Service development. If those sound good to you, here's how to get started.

Decrypting (But Not Really Encrypting) Configuration Settings in ASP.NET Core

You can store encrypted values in your ASP.NET Core configuration file and seamlessly decrypt the values as you retrieve them. But there are, at least, two issues that you'll need to address.

What Are gRPC Web Services and When Should I Use Them?

ASP.NET Core allows you to create Web Services based on gRPC ... which raises two questions: "What is gRPC?" and "Does it ever make sense to use it?" Here are Peter's answers.

Agile Development: How to Pick the Most Valuable User Stories

Some of the critical problems for any team working in an Agile way are managing the backlog of user stories, converting epics into stories, preventing scope creep, and -- most importantly -- picking the most valuable stories for the next sprint. Impact mapping provides a visual solution for all these issues.

How to Update Members of a Collection with LINQ

Sometimes it's just cool to take a walk through some technology to find all the different ways you can solve a problem -- sort of "Fun with the .NET Framework." Here's a look at all the ways that Peter could think of to update an object in a collection ... some of which may be foolish.

The Service Layer in Software Development Doesn't Exist

While the concept of "service classes" probably has some value when it comes to organizing the objects you're dealing with, the idea of a "service layer" has no value at all when it comes to building applications.

Creating a Custom Tag Helper in ASP.NET Core: Generating HTML

The beauty of a tag helper is it's ability to add new HTML to your page. Once you know what you want to change, here are the tools to change the HTML going to the user.

Creating a Custom Tag Helper in ASP.NET Core: Gathering Data

You can create your own custom tag helpers ... but it's a lot easier if you understand the process that tag helpers need to go through. Here are your options when gathering the data that a tag helper needs (and why they can't completely replace HtmlHelpers).

Subscribe on YouTube