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
public class ValidatorBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> | |
where TRequest : IRequest<TResponse> | |
{ | |
private readonly ILogger<ValidatorBehaviour<TRequest, TResponse>> _logger; | |
private readonly IValidator[] _validators; | |
public ValidatorBehaviour(ILogger<ValidatorBehaviour<TRequest, TResponse>> logger, IEnumerable<IValidator> validators) | |
{ | |
_logger = logger; | |
_validators = validators.ToArray(); |
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
USE [master]; | |
GO | |
IF OBJECT_ID('dbo.get_crossdatabase_dependencies') IS NULL | |
BEGIN | |
EXEC ('CREATE PROCEDURE dbo.get_crossdatabase_dependencies AS RETURN 0'); | |
END; | |
GO | |
ALTER PROCEDURE [dbo].[get_crossdatabase_dependencies] |
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
public static class ThreadSafeRandom | |
{ | |
private static readonly Random _globalRandom = new Random(Guid.NewGuid().GetHashCode()); | |
private static readonly ThreadLocal<Random> _localRandom = new ThreadLocal<Random>(() => | |
{ | |
lock (_globalRandom) | |
{ | |
return new Random(_globalRandom.Next()); | |
} |
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
# This small snippet disables Windows Firewall Profiles | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile' -name "EnableFirewall" -Value 0 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile' -name "EnableFirewall" -Value 0 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\Standardprofile' -name "EnableFirewall" -Value 0 |