Category Entity Framework

Using Entity Framework Core to process Azure Service Messages in ASP.NET Core

This article shows how to use Entity Framework Core together with an Azure Service Bus receiver in ASP.NET Core. This message handler is a singleton and so requires that an Entity Framework Core context inside this singleton is not registered as a scoped service but created and disposed for each message event. Code: https://github.com/damienbod/AspNetCoreServiceBus Posts […]

Securing an Angular SignalR client using JWT tokens with ASP.NET Core and Duende IdentityServer

This post shows how an Angular SignalR client can send secure messages using JWT bearer tokens with an API and an STS server. The STS server is implemented using Duende IdentityServer and the API is implemented using ASP.NET Core. Code: https://github.com/damienbod/AspNetCoreAngularSignalRSecurity Posts in this series History 2023-01-08 Updated Angular 15, .NET 72021-01-25 Updated Angular 11.1.0 […]

EF Core diagnosis and features with MS SQL Server

This article shows how Entity Framework Core messages can be logged, and compared using the SQL Profiler and also some of the cool new 1.1 features, but not all. All information can be found on the links at the bottom and especially the excellent docs for EF Core. Code: https://github.com/damienbod/EFCoreFeaturesAndDiag project.json with EF Core packages […]

IdentityServer4, Web API and Angular in a single ASP.NET Core project

This article shows how IdentityServer4 with Identity, a data Web API, and an Angular SPA could be setup inside a single ASP.NET Core project. The application uses the OpenID Connect Implicit Flow with reference tokens to access the API. The Angular application uses webpack to build. Code: https://github.com/damienbod/AspNet5IdentityServerAngularImplicitFlow History: 2019-09-20: Updated ASP.NET Core 3.0, Angular […]

Setting the NLog database connection string in the ASP.NET Core appsettings.json

This article shows how the NLog connection string for the DatabaseTarget can be configured in the appsettings.json in an ASP.NET Core project and not the XML nlog.config file. All the NLog target properties can be configured in code if required and not just in the NLog XML configuration file. Code: https://github.com/damienbod/AspNetCoreNlog 2020-01-12 Updated to .NET […]

Implementing UNDO, REDO in ASP.NET Core

The article shows how to implement UNDO, REDO functionality in an ASP.NET Core application using EFCore and MS SQL Server. This is the first blog in a 3 part series. The second blog will implement the UI using Angular 2 and the third article will improve the concurrent stacks with max limits to prevent memory […]

Authorization Policies and Data Protection with IdentityServer4 in ASP.NET Core

This article shows how authorization policies can be used together with IdentityServer4. The policies are configured on the resource server and the ASP.NET Core IdentityServer4 configures the user claims to match these. The resource server is also setup to encrypt a ‘Description’ field in the SQLite database, so it cannot be read by opening the […]

ASP.NET Core using SQL Localization

This article shows how to use SQL localization in ASP.NET Core using an SQL database. The SQL localization in the demo uses Entity Framework Core to access a SQLite database. This can be configured to use any EF core provider. Code: https://github.com/damienbod/AspNetCoreLocalization Library: https://github.com/damienbod/AspNetCoreLocalization/tree/master/src/Localization.SqlLocalizer NuGet package: https://www.nuget.org/packages/Localization.SqlLocalizer/ Documentation: http://localizationsqllocalizer.readthedocs.io/en/latest/ Posts in this series ASP.NET Core […]

ASP.NET Core with PostgreSQL and Entity Framework Core

This article shows how to use PostgreSQL with ASP.NET Core 3.1 using Entity Framework Core. Code: https://github.com/damienbod/AspNetCoreMultipleProject Posts in this series: Experiments with Entity Framework Core and an ASP.NET Core API ASP.NET Core with PostgreSQL and Entity Framework Core ASP.NET Core with MySQL and Entity Framework Core 2020-01-10: Updated to ASP.NET Core 3.1 2018-12-05: Updated […]

Experiments with Entity Framework Core and an ASP.NET Core API

The article shows some of the ways in which Entity Framework Core can be used together with ASP.NET Core. Both packages run on dotnet which makes it possible to run on Linux, Mac or Windows operating systems. The Entity Framework providers are implemented in separate data access projects using onion architecture. Code: https://github.com/damienbod/AspNetCoreMultipleProject Posts in […]