using System.Collections.Generic;
public record Legacy(string LegacyId, Guid uniqueId);
public static void Main()
var x = Either<int, int>.Right(1);
var y = Either<int, int>.Right(2);
var z = Either<int, int>.Left(5);
var eitherOutput = Try<string>(() => throw new Exception("hey"));
x => Console.WriteLine(x.ToString()),
public static class TryModule
public static Either<Exception, S> Try<S>(Func<S> f)
return Either<Exception, S>.Right(f());
return Either<Exception, S>.Left(e);