using System.Collections.Generic; using <%= fullNamespace %>.Components; using <%= fullNamespace %>.Models; using <%= fullNamespace %>.Tests; namespace <%= fullNamespace %>.Services { public class ServiceProxy : ServiceProxyBase { public ServiceProxy(string baseWebSiteUri) { baseUri = baseWebSiteUri; if (!baseUri.EndsWith("/")) { baseUri += "/"; } fullApiUri = System.IO.Path.Combine(baseUri, "DesktopModules/MVC/<%= fullNamespace %>/API/Example/"); } public ServiceResponse CreateExample(ExampleInfo example) { var result = new ServiceResponse(); result = ServiceHelper.PostRequest>(fullApiUri + "CreateExample", example.ObjectToJson()); return result; } public ServiceResponse> GetExamples(int moduleId) { var result = new ServiceResponse>(); result = ServiceHelper.GetRequest>>(fullApiUri + "GetExamples?moduleId=" + moduleId); return result; } public ServiceResponse GetExample(int itemId) { var result = new ServiceResponse(); result = ServiceHelper.GetRequest>(fullApiUri + "GetExample?itemId=" + itemId); return result; } public ServiceResponse UpdateExample(ExampleInfo example) { var result = new ServiceResponse(); result = ServiceHelper.PostRequest>(fullApiUri + "UpdateExample", example.ObjectToJson()); return result; } public ServiceResponse DeleteExample(int itemId) { var result = new ServiceResponse(); result = ServiceHelper.DeleteRequest>(fullApiUri + "DeleteExample?itemId=" + itemId, string.Empty); return result; } } }