diff --git a/MtgApiManager.Lib.Test/Model/CardTest.cs b/MtgApiManager.Lib.Test/Model/CardTest.cs index ad6865c..168f97b 100644 --- a/MtgApiManager.Lib.Test/Model/CardTest.cs +++ b/MtgApiManager.Lib.Test/Model/CardTest.cs @@ -78,7 +78,7 @@ public void MapCardTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }; diff --git a/MtgApiManager.Lib.Test/Service/CardServiceTest.cs b/MtgApiManager.Lib.Test/Service/CardServiceTest.cs index d1fbbeb..39e8fda 100644 --- a/MtgApiManager.Lib.Test/Service/CardServiceTest.cs +++ b/MtgApiManager.Lib.Test/Service/CardServiceTest.cs @@ -71,7 +71,7 @@ public async Task AllAsyncTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }, new CardDto() @@ -113,7 +113,7 @@ public async Task AllAsyncTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" } }; @@ -215,7 +215,7 @@ public void AllTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }, new CardDto() @@ -257,7 +257,7 @@ public void AllTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" } }; @@ -358,7 +358,7 @@ public async Task FindAsyncTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }; @@ -501,7 +501,7 @@ public void FindTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }; diff --git a/MtgApiManager.Lib.Test/Service/SetServiceTest.cs b/MtgApiManager.Lib.Test/Service/SetServiceTest.cs index e7a435d..1cdee9b 100644 --- a/MtgApiManager.Lib.Test/Service/SetServiceTest.cs +++ b/MtgApiManager.Lib.Test/Service/SetServiceTest.cs @@ -463,7 +463,7 @@ public async Task GenerateBoosterAsyncTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }, new CardDto() @@ -505,7 +505,7 @@ public async Task GenerateBoosterAsyncTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" } }; @@ -606,7 +606,7 @@ public void GenerateBoosterTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" }, new CardDto() @@ -648,7 +648,7 @@ public void GenerateBoosterTest() Toughness = "tough", Type = "type2", Types = new string[] { "type1", "type2" }, - Variations = new int[] { 1, 2, 3 }, + Variations = new string[] { Guid.Empty.ToString() }, Watermark = "watermark" } }; diff --git a/MtgApiManager.Lib/Dto/Cards/CardDto.cs b/MtgApiManager.Lib/Dto/Cards/CardDto.cs index daff0fc..01d5d87 100644 --- a/MtgApiManager.Lib/Dto/Cards/CardDto.cs +++ b/MtgApiManager.Lib/Dto/Cards/CardDto.cs @@ -276,7 +276,7 @@ public string[] Types } [JsonProperty(PropertyName = "variations")] - public int[] Variations + public string[] Variations { get; set; diff --git a/MtgApiManager.Lib/Model/Card/Card.cs b/MtgApiManager.Lib/Model/Card/Card.cs index 72bd33f..af740b0 100644 --- a/MtgApiManager.Lib/Model/Card/Card.cs +++ b/MtgApiManager.Lib/Model/Card/Card.cs @@ -368,7 +368,7 @@ public string[] Types /// /// Gets if a card has alternate art (for example, 4 different Forests, or the 2 Brothers Yamazaki) then each other variation’s multiverseid will be listed here, NOT including the current card’s multiverseid. /// - public int[] Variations + public string[] Variations { get; private set; diff --git a/MtgApiManager.Lib/Service/CardService.cs b/MtgApiManager.Lib/Service/CardService.cs index 666a30d..6382166 100644 --- a/MtgApiManager.Lib/Service/CardService.cs +++ b/MtgApiManager.Lib/Service/CardService.cs @@ -120,60 +120,21 @@ public async override Task>> AllAsync() /// /// The multi verse identifier to query for. /// A representing the result containing a or an exception. - public Exceptional Find(int multiverseId) - { - try - { - var rootCard = CallWebServiceGet(BuildUri(multiverseId.ToString())).Result; - var model = new Card(rootCard.Card); - - return Exceptional.Success(model, MtgApiController.CreatePagingInfo()); - } - catch (AggregateException ex) - { - return Exceptional.Failure(ex.Flatten().InnerException); - } - } + public Exceptional Find(int multiverseId) => FindAsync(multiverseId.ToString()).Result; /// /// Find a specific card by its multi verse identifier. /// /// The identifier to query for. /// A representing the result containing a or an exception. - public Exceptional Find(string id) - { - try - { - var rootCard = CallWebServiceGet(BuildUri(id)).Result; - var model = new Card(rootCard.Card); - - return Exceptional.Success(model, MtgApiController.CreatePagingInfo()); - } - catch (AggregateException ex) - { - return Exceptional.Failure(ex.Flatten().InnerException); - } - } + public Exceptional Find(string id) => FindAsync(id).Result; /// /// Find a specific card by its multi verse identifier. /// /// The multi verse identifier to query for. /// A representing the result containing a or an exception. - public async Task> FindAsync(int multiverseId) - { - try - { - var rootCard = await CallWebServiceGet(BuildUri(multiverseId.ToString())).ConfigureAwait(false); - var model = new Card(rootCard.Card); - - return Exceptional.Success(model, MtgApiController.CreatePagingInfo()); - } - catch (Exception ex) - { - return Exceptional.Failure(ex); - } - } + public Task> FindAsync(int multiverseId) => FindAsync(multiverseId.ToString()); /// /// Find a specific card by its multi verse identifier. @@ -344,4 +305,4 @@ public CardService Where(Expression> property, U return this; } } -} \ No newline at end of file +}