https://aka.ms/aspnetcore-makeover
- Intro (goals/non-goals/what you'll learn)
- Pick The Right Starting Template
- Web Application (no auth)
- Web API
- SPA
https://aka.ms/aspnetcore-makeover
A pyramid, much like Maslow's heirarchy of needs
| using System; | |
| using static System.Text.Encoding; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Configs; | |
| using BenchmarkDotNet.Diagnostics.Windows; | |
| using BenchmarkDotNet.Running; | |
| using Xunit; | |
| using System.Globalization; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; |
| void Main() | |
| { | |
| Log.Logger = new LoggerConfiguration() | |
| .MinimumLevel.Warning() | |
| .Enrich.FromLogContext() | |
| .Enrich.WithProperty("url", "http://serilog.net/") | |
| .WriteTo.Sink(new LinqpadDumpSink()) | |
| .CreateLogger(); | |
| Log.Warning( | |
| "Processing inside {@test}, something weird happened", |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; | |
| using Serilog.Events; | |
| using Serilog.Parsing; |
| namespace Analogy | |
| { | |
| /// <summary> | |
| /// This example shows that a library that needs access to target .NET Standard 1.3 | |
| /// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
| /// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
| /// </summary>INetCoreApp10 | |
| class Example1 | |
| { | |
| public void Net45Application(INetFramework45 platform) |
| <Query Kind="FSharpProgram"> | |
| <NuGetReference>Microsoft.AspNet.WebApi.SelfHost</NuGetReference> | |
| </Query> | |
| type ResponseRecord = {value: int; message: string} | |
| type ResponseDiscriminatedUnion = | |
| | Even of ResponseRecord | |
| | Odd of (int * string) | |
| let getResponse i = |
| module Parsing | |
| /// Remember where we are in the code. | |
| /// This is a struct to keep memory pressure down. | |
| /// (Significant perf improvements on iOS.) | |
| type ParseState = | |
| struct | |
| val Code : string | |
| val Index : int | |
| new (code : string, index : int) = |
| using System; | |
| using System.Runtime.InteropServices; | |
| namespace Things | |
| { | |
| public static class LandLordExtensions | |
| { | |
| public static LandLord<TWrapped> AsDisposable<TWrapped>(this TWrapped tenant) | |
| { | |
| return new LandLord<TWrapped>(tenant); |
| [<AutoOpen>] | |
| module UoM = | |
| // Units of measure for other than integral types | |
| let inline (++) (w: ^W when ^W: (static member IsMeasureAbbrev: ^tm * ^t -> unit)) (t: ^t) = (# "" t: ^tm #) | |
| let inline (--) (w: ^W when ^W: (static member IsMeasureAbbrev: ^tm * ^t -> unit)) (tm: ^tm) = (# "" tm: ^t #) | |
| [<MeasureAnnotatedAbbreviation>] | |
| type Guid<[<Measure>] 'm> = Guid |