Skip to content

Commit c41f76c

Browse files
committed
Fix/improve GET /statements query
* Correct 'activity' parameter name * Implement since/until with .toString * Bump to 0.0.4.0
1 parent 04c5468 commit c41f76c

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

TinCan/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.3.0")]
36-
[assembly: AssemblyFileVersion("0.0.3.0")]
35+
[assembly: AssemblyVersion("0.0.4.0")]
36+
[assembly: AssemblyFileVersion("0.0.4.0")]

TinCan/Statement.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace TinCan
2121
{
2222
public class Statement : StatementBase
2323
{
24+
// TODO: put in common location
2425
private const String ISODateTimeFormat = "o";
2526

2627
public Nullable<Guid> id { get; set; }

TinCan/StatementsQuery.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ namespace TinCan
2020
{
2121
public class StatementsQuery
2222
{
23+
// TODO: put in common location
24+
private const String ISODateTimeFormat = "o";
25+
2326
public Agent agent { get; set; }
2427
public Uri verbId { get; set; }
2528
public Uri activityId { get; set; }
2629
public Nullable<Guid> registration { get; set; }
2730
public Nullable<Boolean> relatedActivities { get; set; }
2831
public Nullable<Boolean> relatedAgents { get; set; }
29-
public DateTime since { get; set; }
30-
public DateTime until { get; set; }
32+
public Nullable<DateTime> since { get; set; }
33+
public Nullable<DateTime> until { get; set; }
3134
public Nullable<Int32> limit { get; set; }
3235
public StatementsQueryResultFormat format { get; set; }
3336
public Nullable<Boolean> ascending { get; set; }
@@ -48,7 +51,7 @@ public Dictionary<String, String> ToParameterMap (TCAPIVersion version)
4851
}
4952
if (activityId != null)
5053
{
51-
result.Add("activityId", activityId.ToString());
54+
result.Add("activity", activityId.ToString());
5255
}
5356
if (registration != null)
5457
{
@@ -62,6 +65,14 @@ public Dictionary<String, String> ToParameterMap (TCAPIVersion version)
6265
{
6366
result.Add("related_agents", relatedAgents.Value.ToString());
6467
}
68+
if (since != null)
69+
{
70+
result.Add("since", since.Value.ToString(ISODateTimeFormat));
71+
}
72+
if (until != null)
73+
{
74+
result.Add("until", until.Value.ToString(ISODateTimeFormat));
75+
}
6576
if (limit != null)
6677
{
6778
result.Add("limit", limit.ToString());

0 commit comments

Comments
 (0)