Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

78 total results found

HowTo Access DI Services

.NET

NOTE: If you are looking for how to generate an instance of ServiceProvider, outside of NET Core runtime, like for a unit test, see this: Duplicating .NET Core DI Here’s a good reference on how DI scoping works: The dangers and gotchas of using scoped service...

DI
.net
.net
programming

HowTo Make .Net Desktop App DPI Aware

.NET

For a better desktop UI experience, it is necessary to have access to the current screen size and pixel density of the display (DPI), so that an application controls and text fonts can be adjusted as needed for good layout and presentation. Here is a list of ...

.net
dotnet
programming

Unit Tests with PostgreSQL Backends

.NET

In order to easily stand up a Postgres database for unit and integration testing, we need a class that can encapsulate the effort, to an easy call surface. Below we have a helper class that will manage the life-cycle of a test database, in PostgreSQL. Given ...

database
dotnet
testing
programming
.net
postgres

EF - Backend vs .NET Datatypes

.NET

Here's a list of what datatypes that Entity Framework uses to store .NET datatypes in a couple different database engines. .NET Datatype SQL Server PostgreSQL SQLite Comments bool bit boolean INTEGER byte tinyint smallint (Postgr...

database
programming
.net
dotnet
EF
EntityFramework
SQLite
postgres
SQL

Unit Testing Conventions

.NET

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 ...

unittests
programming
testing
dotnet
.net

Using Visual Studio with Git

.NET

Visual Studio brings in lots of files and folders that don't belong in a checked in repository. Here's a good gitignore file for Visual Studio projects: # This works in Visual Studio projects # to ignore most VS generated output. # NOTE: It does not work...

programming
git
Visual Studio

Base Domain Type

Object Management Stack

Here are notes about the base domain type, its usage, and design choices. NOTE: Some of these are restrictions of the C# compiler, that makes it necessary to include some boilerplate in domain objects. Design Requirements Here are design requirements for ou...

Dapper
database
EF
DDD
dotnet
.net
programming

Example Derived Type

Object Management Stack

Here's a working example of a domain type that derives from the base type in this page: Base Domain Type /// <summary> /// This is a sample domain type that uses our base type. /// It is only for testing. /// For this type to exist, it requ...

dotnet
.net
programming
database
Dapper
DDD

RabbitMQ Cloud Service RPC Conventions

Other

Here’s a list of conventions followed by cloud services for inter-service RPC communication. RPC, being a request-response type of comms, like a REST call (request and response), requires some a standardized convention when implemented over an async queue tra...

deployment
RMQ
RabbitMQ
programming

RMQ Scenarios

Other

Change Events A service that needs to publish change events for a domain. An example of this would be a security directory that receives a change request for a user account, to change its username. This update would need to be propagated to other services th...

RMQ
RabbitMQ
deployment
programming

OGA.PostGres.Lib Usage

HowTo

Here’s notes on how to create and manage databases with OGA.PostGres.Lib. This applies to use cases for: Standing up a temporary database for unit and integration testing. Creating live database tables with compatible column types for storing class ...

programming
.net
postgres
dotnet

EF: Logging

.NET

Here's some notes on how we implement logging in EF. We've currently implemented it in our dynamic domain dbcontext, DynamicDbContext. To make it work, we just have to create an instance of DbContextLoggingConfig, and pass it to our top-level dbcontext const...

logging
dotnet
.net
programming

EF: Data Contexts - DbContexts

.NET

When working in EF, you will come across the need to create a DbContext type. MS has a base class that you inherit from, called: DbContext. It is useful to implement either a two or three layer DbContext. See this page for EF Logging implementation: EF: Log...

programming
dotnet
.net
EntityFramework
EF
database

Mocking a DBContext for Testing

.NET

The easiest means to mock a data context for testing, is to use an in-memory database. An in-memory database is known by its string-name within a process. Each data context accessing the database instance must use its name, via options. See this page for EF ...

testing
dotnet
programming
.net

VS Library - csproj Contents

.NET

Here are some standard things for the csproj file of a .NET library project. The top Property Group should list the following things: <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <PackageId>OGA.NugetRepoClient.Lib</PackageId> <P...

dotnet
.net
programming

.NET 5 Global Using Error

.NET

If you have a project that is targeting a .NET 5, and you see the following error, follow this page: The error indicates that your csproj file likely has a statement that only works in .NET6 (C# v10) and later. Open your csproj file and look for a statemen...

.net
programming
dotnet

Create Nuget for Multiple Targets or Architectures

.NET

Creating nuget packages that contain libraries for multiple frameworks or runtimes, requires some non-trivial effort.So, this page explains the steps required. Some of this was taken from here: Non-Trivial Multi-Targeting with .NET Project Setup For multipl...

dotnet
nuget
programming
.net

Nuget Build and Publish Scripts for Multiple Targets

.NET

Here’s a set of basic command line steps to run, to generate a nuget package for a library or an executable. NOTE: These statements are for projects that target multiple runtimes. So, they can be simplified for a single runtime or single target framework. Fo...

nuget
programming
dotnet
.net