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

228 total results found

Object Ids

Object Management Stack

Every object is uniquely identifiable, by a standardized UUIDv7. This datatype works across MSSQL, PostgreSQL, SQLite, and Typescript/JavaScript (as string). In Service and Storage In API, services, and backend storage, an object's ID is created as an UUIDv...

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

Net Core DI Truths

.NET

References: NET Core DI Best Practices Here’s a list of behaviors of the NET Core DI registry: All dynamic access to services (from DI) are requested through a service provider.This is what people call a service locator. For example:var foosvc = _servic...

DI
dotnet
.net
programming

IServiceProvider vs IServiceScopeFactory

.NET

References: Net Core DI Truths Internet’s Claim of Anti-Patterns Contrary to what the internet says about service locator usage as anti-pattern, there will always be the need for logic to dynamically access services from DI.This is because the NET Core runti...

programming
DI
dotnet
.net

How to Create IOptions Instance

.NET

It’s pretty standard for classes to require configuration in their constructors in the IOptions form.But, this doesn’t make testing very easy. Here’s a workaround for pushing an IOptions instance into a class constructor, that needs config. This example is f...

dotnet
.net
programming

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

.net
.net
programming
DI

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

dotnet
programming
.net

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

dotnet
database
testing
programming
.net
postgres

EF - DataContext Attributes

.NET

When creating a provider-scoped data context (one for a specific backend), you need to decorate the type with a DataContextAttribute. This allows application code, to easily identify the provider-specific data contexts, to use for a particular backend choice....

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

programming
.net
dotnet
EF
EntityFramework
SQLite
postgres
database
SQL

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

DDD
dotnet
.net
programming
database
Dapper

Type Registry Helper

Object Management Stack

TypeRegistryHelper

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

EF: Derived Stored Types

.NET

If you want to create an entity type that happens to derive from another entity type, JUST TO simplify the codebase, then you may run into this problem. For example: We have a type Widget: public class DOWidget_v1 : DomainBase_v1 { public string Name {...

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

programming
RMQ
RabbitMQ
deployment

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

programming
deployment
RMQ
RabbitMQ

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

postgres
programming
.net
dotnet

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

How to Stop Cell HotSpot Throttling

HowTo

Here's a simple thing to do, to get around hotspot throttling when tethered to a phone. What's happening is that your cell provider is watching the TTL value of packets coming to the cell tower, and looking for ones that have hopped through your cell phone (a...