Skip to content

Instantly share code, notes, and snippets.

View mpetrinidev's full-sized avatar
👨‍💻
Coding

Mauro Petrini mpetrinidev

👨‍💻
Coding
View GitHub Profile
@mpetrinidev
mpetrinidev / Service1.cs
Last active December 4, 2019 11:44
Dapper + MediatR
public class Service1 : IService1
{
private readonly IDbConnection _connection;
private readonly IDbTransaction _transaction;
public Service1(IDbConnection connection, IDbTransaction transaction)
{
_connection = connection;
_transaction = transaction;
}
@mpetrinidev
mpetrinidev / Program.cs
Created September 19, 2019 16:26
youtube-nullcoalescing-c#8
class Program
{
static void Main(string[] args)
{
static int? GetNullAge() => null;
static int? GetAge() => 27;
int? age = GetNullAge();
//Old Way
@mpetrinidev
mpetrinidev / Program.cs
Created August 24, 2019 15:30
Call Github Graphql Api using c#
class Program
{
static async Task Main(string[] args)
{
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.github.com/graphql")
};
httpClient.DefaultRequestHeaders.Add("User-Agent", "MyConsoleApp");
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'app';