123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System.Collections.Generic;
- using System.Linq;
- namespace MiniWebApi.Handler
- {
-
-
-
- public class CallingMethod
- {
-
-
-
- private readonly object _thisObject;
-
-
-
- private readonly IWebApiMethod _method;
-
-
-
- public string Name { get; }
-
-
-
- public IReadOnlyList<CallingParameter> Parameters { get; }
-
-
-
- public WebApiType WebApiType { get; }
-
-
-
-
-
-
-
-
- public CallingMethod(string name, WebApiType webApiType, IEnumerable<CallingParameter> parameters, object thisObject, IWebApiMethod method)
- {
- Name = name;
- WebApiType = webApiType;
- Parameters = parameters.ToList();
- _thisObject = thisObject;
- _method = method;
- }
-
-
-
-
- public void Call(WebApiArgument[] webApiArguments)
- {
- var args = webApiArguments.Select(x => x.Value).ToArray();
- _method.Call(_thisObject, args);
- }
- }
- }
|