From 4015148d34d4d018e6eb45dd57f0f0813f4f713e Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 12 Feb 2020 21:51:17 -0500 Subject: [PATCH] Updated AutoMapper to 9 --- src/SteamWebAPI2/AutoMapperConfiguration.cs | 12 ++++++------ src/SteamWebAPI2/SteamWebAPI2.csproj | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SteamWebAPI2/AutoMapperConfiguration.cs b/src/SteamWebAPI2/AutoMapperConfiguration.cs index 27b298d..a304f91 100644 --- a/src/SteamWebAPI2/AutoMapperConfiguration.cs +++ b/src/SteamWebAPI2/AutoMapperConfiguration.cs @@ -311,7 +311,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - x.CreateMap().ConvertUsing(src => + x.CreateMap().ConvertUsing((src, dest) => { if (src.Result == null) { @@ -324,7 +324,7 @@ public static void Initialize() }); x.CreateMap() - .ForMember(dest => dest.PlaytimeLastTwoWeeks, opts => opts.ResolveUsing(src => + .ForMember(dest => dest.PlaytimeLastTwoWeeks, opts => opts.MapFrom((src, dest) => { if (!src.Playtime2weeks.HasValue) { @@ -332,7 +332,7 @@ public static void Initialize() } return TimeSpan.FromMinutes(src.Playtime2weeks.Value); })) - .ForMember(dest => dest.PlaytimeForever, opts => opts.ResolveUsing(src => + .ForMember(dest => dest.PlaytimeForever, opts => opts.MapFrom((src, dest) => { return TimeSpan.FromMinutes(src.PlaytimeForever); })); @@ -376,7 +376,7 @@ public static void Initialize() #region Endpoint: SteamRemoteStorage x.CreateMap() - .ConvertUsing(src => + .ConvertUsing((src, dest) => { return (PublishedFileVisibility)src; }); @@ -385,12 +385,12 @@ public static void Initialize() .ForMember(dest => dest.PreviewUrl, opts => opts.MapFrom(source => new Uri(source.PreviewUrl))); x.CreateMap>() .ConvertUsing( - src => Mapper.Map, IReadOnlyCollection>( + (src, dest) => Mapper.Map, IReadOnlyCollection>( src.Result?.Result == 1 ? src.Result.Details : null) ); x.CreateMap() .ConvertUsing( - src => Mapper.Map( + (src, dest) => Mapper.Map( src.Result?.Result == 1 ? src.Result.Details?.SingleOrDefault() : null) ); diff --git a/src/SteamWebAPI2/SteamWebAPI2.csproj b/src/SteamWebAPI2/SteamWebAPI2.csproj index f6f278c..091bac3 100644 --- a/src/SteamWebAPI2/SteamWebAPI2.csproj +++ b/src/SteamWebAPI2/SteamWebAPI2.csproj @@ -12,7 +12,7 @@ - +