This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace SView.Global | |
| { | |
| using System; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| /// <summary> | |
| /// https://vagifabilov.wordpress.com/2010/04/02/dont-use-activator-createinstance-or-constructorinfo-invoke-use-compiled-lambda-expressions/ | |
| /// </summary> | |
| public class Activator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Use with caution! http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx */ | |
| public class SomeClass { | |
| private readonly Subject<int> triggerableObservable = | |
| new Subject<int>(); | |
| public IObservable<int> TriggeredObservable => triggerableObservable.AsObservable(); | |
| private IDisposable subscription; | |
| public SomeClass() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Moq; | |
| using Refit; | |
| using Xunit; | |
| namespace Some.Kind.Of.Space | |
| { | |
| [Collection("Feature Name")] | |
| [Trait("Feature Aspect", "Classification")] | |
| public class FeatureClassNameTests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| using System.Text.RegularExpressions; | |
| namespace Extensions | |
| { | |
| public static class StringExtensions | |
| { | |
| private static readonly Regex _keyRegex = new Regex("{([^{}:]+)(?::([^{}]+))?}", RegexOptions.Compiled); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net.Http; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Namespace123 | |
| { | |
| public class MockHttpMessageHandler : HttpMessageHandler | |
| { | |
| private readonly HttpResponseMessage? message; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2025 CodeSoupCafe LLC | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## UUID/GUID Performance in PostgreSQL with C# | |
| The primary performance challenge with UUIDs as primary keys stems from **index fragmentation** caused by their random nature. This impacts both write (INSERT) and read performance (JOINs, lookups). | |
| ### Comparison Table | |
| | Feature | Random UUID (v4 / C# `Guid.NewGuid()`) | Time-Based UUID (v7 / Sequential) | Auto-incrementing Integer (`int` / `bigint`) | | |
| | --- | --- | --- | --- | | |
| | **Indexing** | High fragmentation, random disk I/O | Low fragmentation, sequential disk I/O | Very efficient, sequential data storage | | |
| | **Write Speed** | Slower due to page splits in B-tree indexes | Significantly faster inserts than v4 | Fastest write performance | |