This file contains 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
namespace Validation.Tests | |
{ | |
using System; | |
using System.Collections.Generic; | |
using Xunit; | |
public class User | |
{ | |
public string Name { get; set; } | |
public int Age { get; set; } |
This file contains 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; | |
using NodaTime; | |
namespace Sample | |
{ | |
public class NodaDateTimeUtil | |
{ | |
public static DateTime ConvertToUtcFromCustomTimeZone(string timezone, DateTime datetime) | |
{ | |
var zone = DateTimeZoneProviders.Tzdb.GetZoneOrNull(timezone); |
This file contains 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
# ASP.NET Core (.NET Framework) | |
# Build and test ASP.NET Core projects targeting the full .NET Framework. | |
# Add steps that publish symbols, save build artifacts, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core | |
trigger: | |
- main | |
pool: | |
vmImage: 'windows-latest' |
This file contains 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
trigger: [dev, main] | |
pr: [dev, main] | |
pool: | |
vmImage: 'ubuntu-latest' | |
stages: | |
- stage: build_dev | |
displayName: Build development |
This file contains 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
// Source: https://medium.com/dealeron-dev/storing-passwords-in-net-core-3de29a3da4d2 | |
namespace Core.Services.Hash | |
{ | |
public sealed class HashingOptions | |
{ | |
public const string Hashing = "Hashing"; | |
public int Iterations { get; set; } = 10000; | |
} | |
} |
This file contains 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
// https://dev.to/callmewhy/yo-yo-check-null-320m | |
// replace == null with is null because the == operator can be overloaded. | |
internal static class ThrowIf | |
{ | |
public static class Argument | |
{ | |
public static void IsNull<T>(T argument) | |
{ | |
if (argument is null) | |
{ |
This file contains 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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Threading.Tasks; | |
namespace Infrastructure.Services | |
{ | |
public class HttpClientService : IHttpClientService |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using Microsoft.ApplicationInsights; | |
namespace Infrastructure.Services | |
{ | |
public class AppInsightService : IAppInsightService | |
{ | |
private TelemetryClient _telemetry; |
This file contains 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 gulp = require('gulp'); | |
var minimist = require('minimist'); | |
var sonarqubeScanner = require('sonarqube-scanner'); | |
var knownOptions = { | |
string: 'projectVersion', | |
default: { projectVersion: '1.0' } | |
}; | |
var options = minimist(process.argv.slice(2), knownOptions); |
This file contains 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
import {CanDeactivate, Router} from '@angular/router'; | |
import {Injectable} from '@angular/core'; | |
import {Observable} from 'rxjs/Observable'; | |
import {Observer} from 'rxjs/Observer'; | |
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material'; | |
export interface CanComponentDeactivate { | |
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean; | |
} |
NewerOlder