Skip to content

Instantly share code, notes, and snippets.

View AlbertoMonteiro's full-sized avatar
😎
Writting every day lines fo happy code

Alberto Monteiro AlbertoMonteiro

😎
Writting every day lines fo happy code
View GitHub Profile
using SharpSvn;
using System.Collections.ObjectModel;
string repositoryUrl = "url_do_repositorio";
string trunkPath = "/trunk";
string tagPath = "/tags/tag_name";
using (SvnClient client = new SvnClient())
{
// Obtém os IDs dos últimos 5 commits no trunk
@AlbertoMonteiro
AlbertoMonteiro / 01.md
Last active January 23, 2024 10:11
Migration from Moq to NSubstitute
@AlbertoMonteiro
AlbertoMonteiro / Program.cs
Created March 11, 2012 17:08
Auto Implement INotifyPropertyChanged
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using FluentIL.Cecil;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MethodAttributes = Mono.Cecil.MethodAttributes;
@AlbertoMonteiro
AlbertoMonteiro / ObjectSpread.cs
Created February 14, 2018 23:24
Spread object in C#
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace Playground
{
public class Program
public struct OperationResult<T>
{
public T Result { get; set; }
public Exception Exception { get; }
public bool IsSuccess { get; }
public OperationResult(T result)
{
IsSuccess = true;
Exception = null;
@AlbertoMonteiro
AlbertoMonteiro / Program.cs
Last active December 24, 2021 03:13
CustomSerializeProperty
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
var person = new Person("Alberto", "JobInfo", new JobInfo("CSF", "Software Architect"));
var serializeOptions = new JsonSerializerOptions();
serializeOptions.Converters.Add(new BaseInfoConverter());
@AlbertoMonteiro
AlbertoMonteiro / SampleMigration.cs
Last active December 12, 2021 03:40
SqlServerWithTemporalTablesMigrationsSqlGenerator to use Temporal Tables in migrations with .NET 5.0 and EF Core 5.0
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using System;
namespace ConsoleApp1.Migrations
{
public partial class Initial : Migration
{
@AlbertoMonteiro
AlbertoMonteiro / readme.md
Last active August 17, 2021 02:50
AWS Importing and Exporting SQL Server Databases
@AlbertoMonteiro
AlbertoMonteiro / alberto-theme.psm1
Last active August 14, 2021 10:25
My powershell theme
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
BenchmarkDotNet=v0.13.0, OS=Windows 10.0.18363.1556 (1909/November2019Update/19H2)
Intel Core i7-8665U CPU 1.90GHz (Coffee Lake), 1 CPU, 8 logical and 4 physical cores
.NET SDK=5.0.202
  [Host]     : .NET 5.0.5 (5.0.521.16609), X64 RyuJIT
  DefaultJob : .NET 5.0.5 (5.0.521.16609), X64 RyuJIT