Advanced Search
Search Results
50 total results found
Angular: Access CSS Variables
CSS Variables can be defined in css (or SCSS) like this: NOTE: These are defines in the root element, in the styles.scss file of an app. :root { --sidenav-width: 300px; --sidenav-collapsed-width: 50px; --sidenav-background-color: var(--app-bac...
Web Push Notifications
Here’s some initial references for setting up Push Notifications in web pages. Service Worker API - Web APIs | MDN Push API - Web APIs | MDN Push notifications overview | Articles | web.dev Push notifications are now supported cross-browser | Blog |...
Good Article on Net Core With or Without IIS
Publishing and Running ASP.NET Core Applications with IIS - Rick Strahl's Web Log (west-wind.com)
Raspberry Pi - DotNet Setup
Here’s a short article for setting up a Raspberry PI to run DotNet. Reference Articles We are following this article series: Page #1: RP #01: Setup your Raspberry Pi with Raspberry Pi OS Page 2: RP #02: Install .NET and develop your first .NET application ...
NET Core Func Variables
Here are some use cases for a Func. Func as Method Callback If you want to have a lambda that you pass to a method, like a callback or completion handler, here is an example. Declare the Func, like this: Func<int, int, Task<int>> sigcallback = async (callb...
Regex Notes
Good site for testing Regex matching strings: https://regex101.com/r/iY5hU9/1
Process Logging Behavior
Here’s my current conventions for logging in application processes. Logging features, here are implemented by the Logging class in OGA.Common.Lib. Logging Phases We use three distinct logging phases for an application, each with a distinct purpose. Ear...
Dotnet Dev on Linux
To create a new project at the current folder: dotnet new console --framework net6.0 --use-program-main To run the app: dotnet run
NET Core Error Responses
Here’s a decent mechanism for returning useful errors from a WEB API. Aside: We have a standing test API (OGA.RESTAPI_Testing.Service) that will return examples of this, here: http://192.168.1.201:4250/swagger/index.html We can compose an instance of the Pro...
Six Ways to Multi-Thread
Six ways to initiate tasks on another thread in .NET
Return Multiple Values from Async Method
Async method cannot have Ref or an Out parameters. So, we cannot pass back data from them through typical syntax. This requires us to be a little creative. One way around this CLR limitation is to use tuples.Specifically, we can use an implicit tuple, that wi...
C# Disposed in Derived Types
People make lots of references to Microsoft articles about how to properly handle Dispose in derived class types.But, there is literally no article on the Microsoft that actually shows this use case.So, here’s a collected method, based on a few references, tes...
Consuming Services Inside Startup
During Startup.ConfigureServices During application startup, the Startup.ConfigureServices method is called to register services and configuration with DI.This method allows those services to be consumed across the application. However. During the execution ...
Consuming NET Core Background Service with DI
To properly consumes a background service from a controller or another service, it must be registered with DI. As well, since it’s a background service… it must be running… and probably a singleton. NOTE: If you are looking for how to generate an instance of...
Duplicating .NET Core DI
NOTE: If you are looking for how to access DI services, see this: HowTo Access DI Services Here are the steps to duplicating the .NET Dependency Injection process, to create a ServiceProvider instance. This is especially useful in unit testing, for classes an...
Unit Testing with IServiceProvider
When you create unit tests for class types that directly use DI to retrieve dependencies, you will need a way to give them a reference to a service provider (IServiceProvider). This is transparently done by the runtime.But, we have to mimic it for unit testin...
NET Core Background Services
NOTE: Refer to this page for how to register and consume a background service: Consuming NET Core Background Service with DI General Lots of the ceremony of a background service has been wrapped up and tested, in this class: BackgroundService_Base NOTE: As ...
Unit Testing Conventions
Suppress Async Warning Project-Wide Since we have several calls to base classes for diagnostics and such that are async, it's a good idea to standardize on all Test methods be async. The problem is that not every test method contains an awaited call. so, we ...
VS IDE Suppress Compiler Warnings Project Wide
There are some cases where it is necessary to suppress IDE compiler warnings that apply to the entire project. This can be warnings that occur several times across the source files. Or, it can be for a compiler warning that the project’s framework target is ...
#nullable Warning
If the compiler is giving you warnings about nullable reference types, then you may need to enable nullables in the csproj file. This can happen when you declare a public class property, like this: public TaskConfigBase? ConfigBase { get; set; } Sin...