Background automation tasks in .NET Core – sample console application using Hangfire

I will show a simple console application using Hangfire to automate tasks. First, create a new project: Console App (.NET Core). In my case netcoreapp3.1: Install Hangfire – add packages:Hangfire.CoreHangfire.SqlServer Copy the following code to the Main method: We also need to add namespaces: And the last step, create a database. Go to SSMS andContinue reading “Background automation tasks in .NET Core – sample console application using Hangfire”

IdentityServer configuration to use it with SPA that is not hosted with IdentityServer

IdentityServer settings configuration to use it with SPA that is not hosted with IdentityServer. For example, we have client app on http://localhost:4200 and backend app on https://localhost:5001. To allow working it, we need to set/change “Profile” to “SPA”. Additional we can configure “RedirectUri” and “LogoutUri”. Backend side (.NET Core 3.1).Code snippet of appsettings.json:

OperationalStoreOptions in xUnit

I had little issue with creating IOptions<> to use it with xUnit, so below is solution: var operationalStoreOptions = Options.Create(new OperationalStoreOptions()); Example usingConstructor in my class with DbContext looks like: Corresponding lines of code in my xUnit test class: