Skip to content

Instantly share code, notes, and snippets.

@samyonr
samyonr / EFCoreDropSequenceOrder\EFCoreDropSequenceOrder.DataAccess\AppDbContext.cs
Created December 19, 2024 21:59
EF Core 9 Drop Sequence wrong order and per type sequence instead of united
using EFCoreDropSequenceOrder.Entities;
using Microsoft.EntityFrameworkCore;
namespace EFCoreDropSequenceOrder.DataAccess;
public class AppDbContext(DbContextOptions options) : DbContext(options)
{
// Step 1: Add the DbSet properties for concrete types, generate migration
public DbSet<Dog> Dogs { get; set; }
public DbSet<Cat> Cats { get; set; }
@samyonr
samyonr / Entities\Entities.cs
Last active December 11, 2024 14:50
EntityGraphQL IsAny not working for nullable array of ints
using Microsoft.EntityFrameworkCore;
namespace Entities;
public class DemoContext(DbContextOptions<DemoContext> options) : DbContext(options)
{
public DbSet<Property> Properties { get; set; }
public DbSet<PropertyType> PropertyTypes { get; set; }
public DbSet<Location> Locations { get; set; }
}
@samyonr
samyonr / DataAccess\DataAccess.csproj
Created November 24, 2024 20:08
EntityGraphQL.AspNet 5.5.0 non nullable enum in mutation is not always discoverable
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
@samyonr
samyonr / Entities\Entities.cs
Created November 20, 2024 21:35
EntityGraphQL.AspNet 5.5.2 package doesn't work with StrawberryShake.Server 14.1.0 but works with 13.9.14
using Microsoft.EntityFrameworkCore;
namespace Entities;
public class DemoContext(DbContextOptions<DemoContext> options) : DbContext(options)
{
public DbSet<Property> Properties { get; set; }
public DbSet<PropertyType> PropertyTypes { get; set; }
public DbSet<Location> Locations { get; set; }
}
@samyonr
samyonr / DataAccess\DataAccess.csproj
Created November 12, 2024 10:57
EntityGraphQL.AspNet Validation Attributes Not Working with [GraphQLInputType] version 5.5.0
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
@samyonr
samyonr / DestResultsSet.cs
Last active July 4, 2024 12:17
Riok.Mapperly 3.4.0-3.6.0 bug
namespace MapperlyBug;
public partial record struct DestTimeValueId(DateTime Time, double Value, int? Id);
public partial class DestResultsSet
{
public required IReadOnlyList<IReadOnlyList<DestTimeValueId>> Results { get; set; }
}
@samyonr
samyonr / ConvergingLivenessCondition.tla
Created December 24, 2023 13:35
TLA when strong fairness isn't strong enough: ConvergingLivenessCondition
-------------------- MODULE ConvergingLivenessCondition --------------------
EXTENDS TLC, Integers
(***************************************************************************)
(* A number of actors, each want to transition from IDLE to PREPARED, and *)
(* then from PREPARED to DONE. Once an actor is DONE it'll stay DONE, but *)
(* it can go backward from PREPARED to IDLE if the situation looks dicey. *)
(* *)
(* IDLE <---> PREPARED ---> DONE *)
@samyonr
samyonr / anyRefinement2and3counter.tla
Last active December 25, 2023 08:49
TLA+ refinement from any spec to any other spec
---------------------------- MODULE anyRefinement2and3counter ----------------------------
EXTENDS Naturals
VARIABLES x, y
Init == /\ x = 0
/\ y = 0
TwoCounterStep == /\ x' = (x + 1) % 2
@samyonr
samyonr / dump0_full_test.log
Created December 19, 2021 21:15
rabbitmq_amqp091-go_issue_21_dumps
Goroutine 1
runtime.gopark (C:/sdk/go1.16.7/src/runtime/proc.go:337)
runtime.chanrecv (C:/sdk/go1.16.7/src/runtime/chan.go:576)
runtime.chanrecv1 (C:/sdk/go1.16.7/src/runtime/chan.go:439)
testing.(*T).Run (C:/sdk/go1.16.7/src/testing/testing.go:1239)
testing.runTests.func1 (C:/sdk/go1.16.7/src/testing/testing.go:1511)
testing.tRunner (C:/sdk/go1.16.7/src/testing/testing.go:1193)
testing.runTests (C:/sdk/go1.16.7/src/testing/testing.go:1509)
testing.(*M).Run (C:/sdk/go1.16.7/src/testing/testing.go:1417)
ayyeka.com/dl/amqp.TestMain (C:/go/src/ayyeka.com/dl/amqp/main_test.go:19)