Skip to content

Commit

Permalink
Merge pull request #15 from tranpl/master
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
cctrbic authored Aug 30, 2017
2 parents 88ca3dd + 5f4191c commit 9250681
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions RedcapApi/Api/Redcap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ public Task<string> GetRecordsAsync(RedcapFormat redcapFormat, ReturnFormat retu
/// This method allows you to export the Arms for a project.
/// NOTE: This only works for longitudinal projects. E.g. Arms are only available in longitudinal projects.
/// </summary>
public async Task<string> ExportArms<T>(RedcapFormat redcapFormat, ReturnFormat returnFormat, List<T> arms = null)
public async Task<string> ExportArmsAsync<T>(RedcapFormat redcapFormat, ReturnFormat returnFormat, List<T> arms = null)
{
try
{
Expand Down Expand Up @@ -951,7 +951,7 @@ public async Task<string> ExportArms<T>(RedcapFormat redcapFormat, ReturnFormat
/// <param name="redcapFormat"></param>
/// <param name="returnFormat"></param>
/// <returns>Number of Arms imported</returns>
public async Task<string> ImportArms<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat)
public async Task<string> ImportArmsAsync<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat)
{
try
{
Expand Down Expand Up @@ -990,7 +990,7 @@ public async Task<string> ImportArms<T>(List<T> data, Override overRide, RedcapF
/// <param name="RedcapFormat"></param>
/// <param name="returnFormat"></param>
/// <returns></returns>
public async Task<string> DeleteArms<T>(T data)
public async Task<string> DeleteArmsAsync<T>(T data)
{
try
{
Expand All @@ -1015,7 +1015,7 @@ public async Task<string> DeleteArms<T>(T data)

}

public Task<string> DeleteArms<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat)
public Task<string> DeleteArmsAsync<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions RedcapApi/Interfaces/IRedcap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface IRedcap
/// <param name="returnFormat"></param>
/// <param name="arms"></param>
/// <returns>Arms for the project in the format specified</returns>
Task<string> ExportArms<T>(RedcapFormat redcapFormat, ReturnFormat returnFormat, List<T> arms);
Task<string> ExportArmsAsync<T>(RedcapFormat redcapFormat, ReturnFormat returnFormat, List<T> arms);

/// <summary>
/// This method allows you to import Arms into a project or to rename existing Arms in a project.
Expand All @@ -47,7 +47,7 @@ public interface IRedcap
/// <param name="redcapFormat"></param>
/// <param name="returnFormat"></param>
/// <returns>Number of Arms imported</returns>
Task<string> DeleteArms<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat);
Task<string> DeleteArmsAsync<T>(List<T> data, Override overRide, RedcapFormat redcapFormat, ReturnFormat returnFormat);
/// <summary>
/// This method allows you to delete Arms from a project. Notice: Because of this method's destructive nature, it is only available for use for projects in Development status. Additionally, please be aware that deleting an arm also automatically deletes all events that belong to that arm, and will also automatically delete any records/data that have been collected under that arm (this is non-reversible data loss).
/// NOTE: This only works for longitudinal projects.
Expand All @@ -58,7 +58,7 @@ public interface IRedcap
/// <param name="RedcapFormat"></param>
/// <param name="returnFormat"></param>
/// <returns></returns>
Task<string> DeleteArms<T>(T data);
Task<string> DeleteArmsAsync<T>(T data);
Task<string> ExportEvents(int[] arms, OverwriteBehavior overwriteBehavior, RedcapFormat RedcapFormat, ReturnFormat returnFormat);
Task<string> ImportEvents(int[] arms, OverwriteBehavior overwriteBehavior, RedcapFormat RedcapFormat, ReturnFormat returnFormat);
Task<string> DeleteEvents(int[] arms, OverwriteBehavior overwriteBehavior, RedcapFormat RedcapFormat, ReturnFormat returnFormat);
Expand Down
1 change: 1 addition & 0 deletions RedcapApi/Redcap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<AssemblyVersion>0.2.4.0</AssemblyVersion>
<PackageTags>redcap</PackageTags>
<PackageReleaseNotes>initial alpha release</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion RedcapApiDemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static void Main(string[] args)
var redcap_api = new RedcapApi("3D57A7FA57C8A43F6C8803A84BB3957B", "http://localhost/redcap/api/");

var armList = new List<int> {2 }.ToArray();
var result = redcap_api.DeleteArms(armList).Result;
var result = redcap_api.DeleteArmsAsync(armList).Result;
var data = JsonConvert.DeserializeObject(result);
Console.WriteLine(data);
Console.ReadLine();
Expand Down

0 comments on commit 9250681

Please sign in to comment.