View Protobuf.cs
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
[HttpGet] | |
public IActionResult Get() | |
{ | |
var person = new Person | |
{ | |
FirstName = "Sam", | |
BillingAddress = new Address | |
{ | |
StreeNumber = "100", | |
Street = "Somewhere", |
View countrydata.cshtml
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
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 |
View ioc_container.dart
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 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; |
View BadStringFormat.cs
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.Globalization; | |
namespace CodeRulesExample; | |
public static class Program | |
{ | |
public static void Main() => | |
Console.WriteLine(string.Format(new CultureInfo("en-US"), "Hello {0}{1}!", "World")); | |
} |
View bloc.dart
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 '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(); |
View TypelessGaphQL.cs
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 GraphQLParser; | |
using GraphQLParser.AST; | |
using Jayse; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Newtonsoft.Json; | |
using System.Collections; | |
using System.Collections.Immutable; | |
namespace TypelessGraphQL; |
View CodeAnalysis.csproj
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
<AnalysisMode>AllEnabledByDefault</AnalysisMode> | |
<AnalysisLevel>latest</AnalysisLevel> | |
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
View MultiTargeting.csproj
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFrameworks>net6.0, net45, netstandard2_0</TargetFrameworks> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
</Project> |
View Example.cs
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
#nullable enable | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace TestProject4 | |
{ | |
public interface IDependency { void DoSomething(); } | |
public class NullDependency : IDependency | |
{ |
View JsonExtensions.cs
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 Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System; | |
using System.Collections.Generic; | |
using System.Collections.Immutable; | |
#pragma warning disable format | |
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. | |
#pragma warning disable CS8604 // Possible null reference argument. |
NewerOlder