Skip to content

Commit

Permalink
Fixed bug with GetBets and null fields.
Browse files Browse the repository at this point in the history
Added GetFeed(sportId)
  • Loading branch information
anderj017 committed Apr 6, 2015
1 parent 1138e4b commit eda3bc8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Data/Bet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Enums/PlaceBetResponseStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public enum PlaceBetResponseStatus
{
Accepted,
PendingAcceptance, // live bets in the danger zone
ProcessedWithError
PROCESSED_WITH_ERROR
}
}
8 changes: 7 additions & 1 deletion PinnacleClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("&currencycode={0}", currency);

Expand Down Expand Up @@ -130,6 +131,11 @@ protected Feed GetFeed(int sportId, int[] leagueIds, OddsFormat format, string c
return GetXmlAsync<FeedResponse>(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);
Expand Down
4 changes: 2 additions & 2 deletions PinnacleWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
<Compile Include="Data\ClientBalance.cs" />
<Compile Include="Data\Currency.cs" />
<Compile Include="Data\Event.cs" />
<Compile Include="Data\Feed.cs" />
<Compile Include="Data\FeedLeague.cs" />
<Compile Include="Data\FeedSport.cs" />
<Compile Include="Data\GetBetsResponse.cs" />
<Compile Include="Data\GetInRunningResponse.cs" />
Expand All @@ -67,6 +65,8 @@
<Compile Include="Data\MoneyLine.cs" />
<Compile Include="Enums\OddsFormat.cs" />
<Compile Include="Data\Period.cs" />
<Compile Include="Data\Feed.cs" />
<Compile Include="Data\FeedLeague.cs" />
<Compile Include="PinnacleClient.cs" />
<Compile Include="Enums\PlaceBetErrorCode.cs" />
<Compile Include="Data\PlaceBetRequest.cs" />
Expand Down

0 comments on commit eda3bc8

Please sign in to comment.