Skip to content

Commit fc89105

Browse files
committed
Some cleanup & code arrange
1 parent 5ac5085 commit fc89105

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

src/redmine-net-api/Extensions/RedmineManagerExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public static async Task<User> GetCurrentUserAsync(this RedmineManager redmineMa
702702
}
703703

704704
/// <summary>
705-
/// Creates the or update wiki page asynchronous.
705+
/// Creates or updates wiki page asynchronous.
706706
/// </summary>
707707
/// <param name="redmineManager">The redmine manager.</param>
708708
/// <param name="projectId">The project identifier.</param>
@@ -730,7 +730,7 @@ public static async Task<WikiPage> CreateWikiPageAsync(this RedmineManager redmi
730730
}
731731

732732
/// <summary>
733-
/// Creates or update wiki page asynchronous.
733+
/// Creates or updates wiki page asynchronous.
734734
/// </summary>
735735
/// <param name="redmineManager">The redmine manager.</param>
736736
/// <param name="projectId">The project identifier.</param>

src/redmine-net-api/Net/RedmineApiUrls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public string DeleteFragment<T>(string id)
194194

195195
return DeleteFragment(type, id);
196196
}
197-
internal string DeleteFragment(Type type,string id)
197+
internal string DeleteFragment(Type type, string id)
198198
{
199199
return $"{TypeFragment(TypeUrlFragments, type)}/{id}.{Format}";
200200
}

src/redmine-net-api/Types/IssueRelation.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ private static IssueRelationType ReadIssueRelationType(string value)
205205
return IssueRelationType.CopiedFrom;
206206
}
207207

208+
#if NETFRAMEWORK
208209
return (IssueRelationType)Enum.Parse(typeof(IssueRelationType), value, true);
210+
#else
211+
return Enum.Parse<IssueRelationType>(value, true);
212+
#endif
209213
}
210214

211215
#endregion

src/redmine-net-api/Types/News.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ public override void ReadJson(JsonReader reader)
167167
case RedmineKeys.PROJECT: Project = new IdentifiableName(reader); break;
168168
case RedmineKeys.SUMMARY: Summary = reader.ReadAsString(); break;
169169
case RedmineKeys.TITLE: Title = reader.ReadAsString(); break;
170-
case RedmineKeys.ATTACHMENTS: Attachments = reader.ReadAsCollection<Attachment>();
171-
break;
172-
case RedmineKeys.COMMENTS: Comments = reader.ReadAsCollection<NewsComment>();
173-
break;
170+
case RedmineKeys.ATTACHMENTS: Attachments = reader.ReadAsCollection<Attachment>(); break;
171+
case RedmineKeys.COMMENTS: Comments = reader.ReadAsCollection<NewsComment>(); break;
174172
default: reader.Read(); break;
175173
}
176174
}

src/redmine-net-api/Types/PagedResults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public PagedResults(IEnumerable<TOut> items, int total, int offset, int pageSize
3737
Offset = offset;
3838
PageSize = pageSize;
3939

40-
if (pageSize <= 0)
40+
if (pageSize <= 0 || total == 0)
4141
{
4242
return;
4343
}

0 commit comments

Comments
 (0)