Columns


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.

ASP.NET Core Security, Part 2

Eric Vogel follows up on his previous post on getting started with ASP.NET Core security. Now that .NET Core 3.0 is out, he shows how to upgrade the code from Part 1 to ASP.NET Core 3.0, put pages behind login, create user roles, and use existing roles to restrict access to pages.

Green Spiral Graphic

How to Do Logistic Regression Using ML.NET

Microsoft Research's Dr. James McCaffrey show how to perform binary classification with logistic regression using the Microsoft ML.NET code library. The goal of binary classification is to predict a value that can be one of just two discrete possibilities, for example, predicting if a person is male or female

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.

Two 'Gotchas' (and Fixes) for Blazor in .NET Core 3.0

The release version of Blazor contains two surprising changes (surprising, at least, to Peter) -- changes that broke some of his code. Here are both of those "gotchas" with the workarounds that he implemented.

City Lights Illustration

Getting Started with AutoML for ML.NET

Dr. James McCaffrey provides hands-on examples in introducing ML.NET, for machine learning prediction models, and AutoML, which automatically examines different ML algorithms, finds the best one, and creates a Visual Studio project with the C# code backing the best model, along with C# code that shows how to use the trained model to make a prediction.

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.

Matrix

How to Do Neural Network Glorot Initialization Using Python

Microsoft Research data scientist Dr. James McCaffrey explains what neural network Glorot initialization is and why it's the default technique for weight initialization.

Color Shards

How to Integrate Blazor Components

You can create Blazor components by combining other Blazor components but you'll almost certainly need to share data between those components. Here are all the options currently open to you.

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.

How To Code Modern Neural Networks Using Python and NumPy

Data scientist Dr. James McCaffrey begins a series on presenting and explaining the most common modern techniques used for neural networks, for which over the past couple of years there have been many small but significant changes in the default techniques used.

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.

How to Do Thompson Sampling Using Python

Suppose you have three different Internet advertising strategies and you want to determine which of them is the best as quickly as possible. Or suppose you work for a medical company and you want to determine which of three new drugs is the most effective. Resident data scientist Dr. James McCaffrey shows how Thompson Sampling can help.

How to Dynamically Build the UI in Blazor Components

You have two tools for generating your initial UI in a Blazor component: ASP.NET's Razor and Blazor's RenderFragment. Here's how to use both to integrate with your C# code (and a warning about what you can't do).

Subscribe on YouTube