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 sealed class DisableSemanticLoggingDecorator : ILogger | |
{ | |
private readonly ILogger _logger; | |
public DisableSemanticLoggingDecorator(ILogger logger) => _logger = logger; | |
public IDisposable BeginScope<TState>(TState state) => _logger.BeginScope(state); | |
public bool IsEnabled(LogLevel logLevel) => _logger.IsEnabled(logLevel); |
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.Threading.Tasks; | |
using Xunit; | |
namespace XunitParallel | |
{ | |
public abstract class GasTests | |
{ | |
private readonly WebDriver _driver; |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc() | |
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2) | |
.AddFluentValidation(config => | |
{ | |
config.RegisterValidatorsFromAssemblyContaining<FooValidator>(); | |
config.RunDefaultMvcValidationAfterFluentValidationExecutes = false; | |
}) | |
.ConfigureApiBehaviorOptions(options => |
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.Linq; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.Configuration; | |
using Microsoft.Extensions.Options; | |
namespace Gelf.Extensions.Logging.Samples.AspNetCore2 |
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.Linq; | |
using Newtonsoft.Json; | |
namespace JsonFormat | |
{ | |
public class Program | |
{ | |
private const string InputData = @"{ |
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 Autofac.Extras.Moq; | |
using Moq; | |
using NUnit.Framework; | |
namespace Sandbox | |
{ | |
public class AutoMockFunctionTests | |
{ | |
[Test] |
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 Moq; | |
namespace MoqDemo | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var mockSqlUtility = new Mock<SqlUtility> {CallBase = true}; |
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.Threading; | |
using System.Threading.Tasks; | |
namespace CancelSearch | |
{ | |
class Program | |
{ | |
static void Main() |
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
class Program | |
{ | |
static void Main() | |
{ | |
HttpAsync().Wait(); | |
Console.ReadKey(); | |
} | |
private static async Task HttpAsync() | |
{ |
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 Autofac; | |
namespace LinkedList | |
{ | |
public class Program | |
{ | |
static void Main() | |
{ | |
var builder = new ContainerBuilder(); |