Skip to content

Commit

Permalink
Use extend method for converting delegate to APIFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
arenekosreal committed May 15, 2024
1 parent 793a4e9 commit ad21559
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion E5Renewer/Models/GraphAPIs/FuncExtends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class FuncExtends
/// <param name="method">The method to convert.</param>
/// <param name="id">The id of msgraph api.</param>
/// <param name="logger">The logger to generate log.</param>
public static KeyValuePair<string, APIFunction> ToAPIFunction(Func<GraphServiceClient, Task<object?>> method, string id, ILogger logger)
public static KeyValuePair<string, APIFunction> ToAPIFunction(this Func<GraphServiceClient, Task<object?>> method, string id, ILogger logger)
{
return new(id,
async (client) =>
Expand Down
2 changes: 1 addition & 1 deletion E5Renewer/Models/GraphAPIs/GetAPIFunctionsContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private IEnumerable<KeyValuePair<string, APIFunction>> GetAPIFunctionsWithoutCac
Func<GraphServiceClient, Task<object?>>? func = d as Func<GraphServiceClient, Task<object?>>;
if (func is not null)
{
KeyValuePair<string, APIFunction> kv = FuncExtends.ToAPIFunction(func, id, this.logger);
KeyValuePair<string, APIFunction> kv = func.ToAPIFunction(id, this.logger);
this.cache.Add(kv);
yield return kv;
}
Expand Down

0 comments on commit ad21559

Please sign in to comment.