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.Data; | |
using System.Data.SqlClient; | |
internal class Program | |
{ | |
static int threads = 0; | |
static int records = 0; | |
static int batch = 10_000; | |
static DateTime started = DateTime.Now; |
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
SET NOCOUNT ON | |
DECLARE @json NVARCHAR(MAX) = | |
'{ | |
"reading": { | |
"source": "A01", | |
"values": [ | |
{ "date": "2022-12-12", "value": 123.456 } | |
, { "date": "2022-12-13", "value": 234.567 } | |
] |
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.Dynamic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Text.Json; | |
using System.Xml.Linq; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Engines; | |
using BenchmarkDotNet.Running; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
DROP TABLE IF EXISTS #SSN | |
CREATE TABLE #SSN ( | |
ID INT IDENTITY(1, 1) PRIMARY KEY | |
, SSN VARCHAR(11) MASKED WITH (FUNCTION = 'partial(0, "XXX-XX-", 4)') | |
, SEX BIT | |
, BIRTH INT | |
) | |
GO |
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 Library.Models; | |
using Library.EF; | |
namespace Abstractions | |
{ | |
public interface IKeyedModel | |
{ | |
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] | |
public int Id { get; set; } | |
} |
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
DBCC DROPCLEANBUFFERS; | |
CHECKPOINT; | |
DBCC FREEPROCCACHE WITH no_infomsgs; | |
GO | |
CREATE OR ALTER FUNCTION Range (@start BIGINT, @end BIGINT) | |
RETURNS @table TABLE (Id BIGINT) AS | |
BEGIN | |
-- Jerry Nixon |
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
BEGIN TRANSACTION | |
CREATE TABLE x | |
( | |
Id INT NOT NULL PRIMARY KEY | |
, Name VARCHAR(150) NOT NULL | |
); | |
WITH generator (Id, Name) AS |
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
Console.Clear(); | |
Console.CursorVisible = false; | |
var cat = new Cat(); | |
while (true) | |
{ | |
cat.Erase(); | |
if (Console.KeyAvailable) |
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
var x = 4; | |
var y = x.ToString(); // y equals "4" | |
var x = 4; | |
var y = x.ToString("##"); // y equals "4" | |
var x = 4; | |
var y = x.ToString("###"); // y equals "4" | |
var x = 4; |