Skip to content

Instantly share code, notes, and snippets.

View Neftedollar's full-sized avatar
😎
whereing glasses

Roman Melnikov Neftedollar

😎
whereing glasses
View GitHub Profile
// <PropertyGroup>
// <OutputType>Exe</OutputType>
// <TargetFramework>netcoreapp3.0</TargetFramework>
// </PropertyGroup>
type ApplicationUser(name, email) =
inherit MongoIdentityUser<Guid>(name, email)
new(name) = ApplicationUser(name,name)
new() = ApplicationUser()
@Neftedollar
Neftedollar / gist:f0c37a552565eb7951cffab30da20e7d
Last active July 9, 2019 13:38
TypeShape & Thoth.Json.Net
// Learn more about F# at http://fsharp.org
open Thoth.Json.Net
open TypeShape.Core.Core
open FSharp.Reflection
open Groot.Contracts.SportRadar.Types.Soccer
open System
let apply (d1:Decoder<'C -> 'B>) (d2:Decoder<'C>) : Decoder<'B> =
type Test =
{ EntityId: string }
type Test2 =
{ EntityId: string
Name: string
Length: int }
let inline (|HasEntityId|) x =
/// Call all specified tasks sequentially one after the other and combine the results together.
let seq (tasks: OrchestratorBuilder.ContextTask<'a> list) =
let rec work acc (rem : OrchestratorBuilder.ContextTask<'a> list) =
match rem with
| [] -> fun _ -> Task.FromResult (acc |> List.rev)
| d :: rest -> orchestrator {
let! t = d
return! work (t::acc) rest
}
work [] tasks
module Server =
open Shared
open Fable.Remoting.Client
/// A proxy you can use to talk to server directly
let api : ICounterProtocol =
Proxy.createWithBuilder<ICounterProtocol> Route.builder