Last active
November 29, 2017 10:26
-
-
Save SlowLogicBoy/715e30af169383e4e8ed95419d333ca9 to your computer and use it in GitHub Desktop.
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
#! "netcoreapp2.0" | |
#r "nuget:NetStandard.Library,2.0.0" | |
#r "nuget:LanguageExt.Core,*" | |
#r "nuget:AgileObjects.AgileMapper,*" | |
#r "nuget:Microsoft.Extensions.DependencyInjection,*" | |
#r "nuget:Microsoft.Extensions.Logging,*" | |
#r "nuget:Serilog,*" | |
#r "nuget:Serilog.Extensions.Logging,*" | |
using AgileObjects.AgileMapper; | |
using LanguageExt; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Serilog; | |
class RandomModel { | |
public string PropertyOne { get; set; } | |
public override string ToString () => RecordType<RandomModel>.ToString(this); //Annoying Line | |
} | |
class AnotherModel { | |
public string AnotherProperty { get; set; } | |
public override string ToString () => RecordType<AnotherModel>.ToString (this); //Annoying Line | |
} | |
Mapper.WhenMapping | |
.From<RandomModel>().To<AnotherModel>() | |
.Map(ctx => ctx.Source.PropertyOne).To(anotherModel => anotherModel.AnotherProperty); //Annoying Line | |
var sc = new ServiceCollection().AddLogging(lb => lb.AddSerilog(dispose: true)); //Annoying line | |
var model = new RandomModel { PropertyOne = "Hi I'm property one" }; | |
Console.WriteLine (model); | |
Console.WriteLine (Mapper.Map(model).ToANew<AnotherModel>()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment