Skip to content

Commit

Permalink
remove DynamicDictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
lvermeulen committed Apr 14, 2019
1 parent 32e8550 commit 09361ad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 78 deletions.
30 changes: 0 additions & 30 deletions src/Bitbucket.Net/Common/DynamicDictionary.cs

This file was deleted.

10 changes: 5 additions & 5 deletions src/Bitbucket.Net/Core/Admin/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ public async Task<bool> CreateAdminUserAsync(string name, string password, strin

public async Task<UserInfo> UpdateAdminUserAsync(string name = null, string displayName = null, string emailAddress = null)
{
var data = new DynamicDictionary
var data = new
{
{ name, "name" },
{ displayName, "displayName" },
{ emailAddress, "email" }
name,
displayName,
email = emailAddress
};

var response = await GetAdminUrl("/users")
.PutJsonAsync(data.ToDictionary())
.PutJsonAsync(data)
.ConfigureAwait(false);

return await HandleResponseAsync<UserInfo>(response).ConfigureAwait(false);
Expand Down
22 changes: 11 additions & 11 deletions src/Bitbucket.Net/Core/Projects/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,16 @@ public async Task<Repository> UpdateProjectRepositoryAsync(string projectKey, st
string targetProjectKey = null,
bool? isPublic = null)
{
var data = new DynamicDictionary
var data = new
{
{ targetName, "name" },
{ isForkable, "forkable" },
{ targetProjectKey, "project", targetProjectKey == null ? null : new ProjectRef { Key = targetProjectKey } },
{ isPublic, "public" }
name = targetName,
forkable = isForkable,
project = targetProjectKey == null ? null : new ProjectRef { Key = targetProjectKey },
@public = isPublic
};

var response = await GetProjectsReposUrl(projectKey, repositorySlug)
.PutJsonAsync(data.ToDictionary())
.PutJsonAsync(data)
.ConfigureAwait(false);

return await HandleResponseAsync<Repository>(response).ConfigureAwait(false);
Expand Down Expand Up @@ -1693,15 +1693,15 @@ public async Task<Tag> CreateProjectRepositoryTagAsync(string projectKey, string
string startPoint,
string message)
{
var data = new DynamicDictionary
var data = new
{
{ name, "name" },
{ startPoint, "startPoint" },
{ message, "message" }
name,
startPoint,
message
};

var response = await GetProjectsReposUrl(projectKey, repositorySlug, "/tags")
.PostJsonAsync(data.ToDictionary())
.PostJsonAsync(data)
.ConfigureAwait(false);

return await HandleResponseAsync<Tag>(response).ConfigureAwait(false);
Expand Down
32 changes: 0 additions & 32 deletions test/Bitbucket.Net.Tests/Common/DynamicDictionaryShould.cs

This file was deleted.

0 comments on commit 09361ad

Please sign in to comment.