From eda3bc8cef7c06cb5cb35449b24fe6c908856559 Mon Sep 17 00:00:00 2001 From: "Jesse-PC\\Jesse" Date: Mon, 6 Apr 2015 23:33:23 +1000 Subject: [PATCH] Fixed bug with GetBets and null fields. Added GetFeed(sportId) --- Data/Bet.cs | 6 +++--- Enums/PlaceBetResponseStatus.cs | 2 +- PinnacleClient.cs | 8 +++++++- PinnacleWrapper.csproj | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Data/Bet.cs b/Data/Bet.cs index e1c45d9..2876b01 100644 --- a/Data/Bet.cs +++ b/Data/Bet.cs @@ -22,7 +22,7 @@ public class Bet public decimal Risk; [JsonProperty(PropertyName = "winLoss")] - public decimal WinLoss; + public decimal? WinLoss; [JsonProperty(PropertyName = "betStatus")] public BetStatus BetStatus; @@ -85,10 +85,10 @@ public class Bet public decimal? Team2Score; [JsonProperty(PropertyName = "ftTeam1Score")] - public decimal FullTimeTeam1Score; + public decimal? FullTimeTeam1Score; [JsonProperty(PropertyName = "ftTeam2Score")] - public decimal FullTimeTeam2Score; + public decimal? FullTimeTeam2Score; [JsonProperty(PropertyName = "pTeam1Score")] public decimal? PartTimeTeam1Score; diff --git a/Enums/PlaceBetResponseStatus.cs b/Enums/PlaceBetResponseStatus.cs index 12c2cd4..19dc966 100644 --- a/Enums/PlaceBetResponseStatus.cs +++ b/Enums/PlaceBetResponseStatus.cs @@ -8,6 +8,6 @@ public enum PlaceBetResponseStatus { Accepted, PendingAcceptance, // live bets in the danger zone - ProcessedWithError + PROCESSED_WITH_ERROR } } diff --git a/PinnacleClient.cs b/PinnacleClient.cs index e289e6f..731b94d 100644 --- a/PinnacleClient.cs +++ b/PinnacleClient.cs @@ -82,7 +82,8 @@ protected string GetFeedRequestUri(int sportId, int[] leagueId, OddsFormat forma { var sb = new StringBuilder(); sb.AppendFormat("feed?sportid={0}", sportId); - sb.AppendFormat("&leagueid={0}", string.Join("-", leagueId)); + if (leagueId.Length > 0) + sb.AppendFormat("&leagueid={0}", string.Join("-", leagueId)); sb.AppendFormat("&oddsformat={0}", (int)format); sb.AppendFormat("¤cycode={0}", currency); @@ -130,6 +131,11 @@ protected Feed GetFeed(int sportId, int[] leagueIds, OddsFormat format, string c return GetXmlAsync(uri).Feed; } + public Feed GetFeed(int sportId) + { + return GetFeed(sportId, new int[]{}, OddsFormat, CurrencyCode, -1, -1); + } + public Feed GetFeed(int sportId, int[] leagueIds) { return GetFeed(sportId, leagueIds, OddsFormat, CurrencyCode, -1, -1); diff --git a/PinnacleWrapper.csproj b/PinnacleWrapper.csproj index 06f8b23..20e303f 100644 --- a/PinnacleWrapper.csproj +++ b/PinnacleWrapper.csproj @@ -55,8 +55,6 @@ - - @@ -67,6 +65,8 @@ + +