diff options
| author | Avi Levkovich <avi@twine-s.com> | 2019-02-20 12:22:27 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2019-02-20 12:22:27 +0200 |
| commit | a576283d2a9288938796491582dd9f575f3ff571 (patch) | |
| tree | bba67d4b69f337fa209b5050fb69378e28e6f4eb /Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml | |
| parent | b30e6dc276f95c9db3d500d267a273b6486e0dac (diff) | |
| parent | 9646611a494ed9e1ef0673c881ffc66b997f7bb9 (diff) | |
| download | Tango-a576283d2a9288938796491582dd9f575f3ff571.tar.gz Tango-a576283d2a9288938796491582dd9f575f3ff571.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml')
| -rw-r--r-- | Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml new file mode 100644 index 000000000..100171849 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml @@ -0,0 +1,51 @@ +@{ + Tango.CodeGeneration.TangoWebClientCodeFile model = Model as Tango.CodeGeneration.TangoWebClientCodeFile; +} + +using System.Threading.Tasks; +using Tango.Web; +using Tango.Web.Authentication; + +namespace @(model.Namespace) +{ + /// <summary> + /// Represents a machine service @(model.ControllerName) web client. + /// </summary> + /// <seealso cref="Tango.Web.TangoWebClient" /> + public abstract class @(model.Name) : TangoWebClient<@(model.LoginRequest), @(model.LoginResponse)> + { + /// <summary> + /// Initializes a new instance of the <see cref="@(model.Name)"/> class. + /// </summary> + /// <param name="environment">The environment.</param> + /// <param name="token">Existing token.</param> + public @(model.Name)(DeploymentSlot environment, WebToken token) : base(environment, "@(model.ControllerName)", token) + { + + } + + /// <summary> + /// Initializes a new instance of the <see cref="@(model.Name)"/> class. + /// </summary> + /// <param name="environment">The environment.</param> + public @(model.Name)(DeploymentSlot environment) : this(environment, null) + { + + } + + @foreach (var action in model.Actions) + { + <div> + /// <summary> + /// Executes the @(action.Name) action and returns @(action.Response). + /// </summary> + /// <returns></returns> + public Task<@(action.Response)> @(action.Name)(@(action.Request) request) + { + return Post<@(action.Request), @(action.Response)>("@(action.Name)", request); + } + + </div> + } + } +}
\ No newline at end of file |
