This file contains hidden or 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 GraphQLParser; | |
| using GraphQLParser.AST; | |
| using Jayse; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using Newtonsoft.Json; | |
| using System.Collections; | |
| using System.Collections.Immutable; | |
| namespace TypelessGraphQL; |
This file contains hidden or 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 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| class Bloc<T> { | |
| late T _state; | |
| final T initialState; | |
| late final Future<T> Function(T state, BlocEvent event)? _eventHandler; | |
| late final T Function(T state, BlocEvent event)? _eventHandlerSync; | |
| final StreamController<T> streamController = StreamController<T>.broadcast(); |
This file contains hidden or 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.Globalization; | |
| namespace CodeRulesExample; | |
| public static class Program | |
| { | |
| public static void Main() => | |
| Console.WriteLine(string.Format(new CultureInfo("en-US"), "Hello {0}{1}!", "World")); | |
| } |
This file contains hidden or 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 IocContainer { | |
| final Map<Type, Object Function(IocContainer container)> _factories = {}; | |
| IocContainer add<T>(T Function(IocContainer container) get) { | |
| _factories.putIfAbsent( | |
| typeOf<T>(), () => get as Object Function(IocContainer container)); | |
| return this; | |
| } | |
| T get<T>() => _factories[typeOf<T>()]!(this) as T; |
This file contains hidden or 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
| page "/countrydata" | |
| @using BlazorApp1.Data | |
| @using RestClient.Net; | |
| <h1>Countries</h1> | |
| <p>This page shows data about countries.</p> | |
| @if (countries == null) | |
| { | |
| <p><em>Loading...</em></p> | |
| } | |
| else |
This file contains hidden or 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
| [HttpGet] | |
| public IActionResult Get() | |
| { | |
| var person = new Person | |
| { | |
| FirstName = "Sam", | |
| BillingAddress = new Address | |
| { | |
| StreeNumber = "100", | |
| Street = "Somewhere", |
This file contains hidden or 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 Microsoft.Extensions.Logging; | |
| using Microsoft.Extensions.Logging.Abstractions; | |
| using System; | |
| namespace ConsoleApp | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
This file contains hidden or 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 ConsoleApp | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| new Example().Print("Hello World!"); | |
| } | |
| } |
This file contains hidden or 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 Example(ILoggerFactory? loggerFactory = null) | |
| { | |
| _loggerFactory = loggerFactory ?? NullLoggerFactory.Instance; | |
| _logger = _loggerFactory.CreateLogger<Example>(); | |
| } |
This file contains hidden or 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 abstract class BaseClass | |
| { | |
| protected ILogger Logger { get; } | |
| protected BaseClass(ILogger logger) | |
| { | |
| Logger = logger; | |
| } | |
| } |