using RestSharp; using System; using System.Collections.Generic; using Tanshu.Accounts.Entities; namespace Tanshu.Accounts.Repository { public static class MachineLocationBI { public static IList List() { var request = new RestRequest(); request.Resource = "MachineLocations.json"; return JsonStore.Execute>(request); } public static MachineLocation Get(string machineName) { var request = new RestRequest(); request.Resource = "MachineLocation.json"; request.AddQueryParameter("n", machineName); return JsonStore.Execute(request); } public static MachineLocation Get(Guid id) { var request = new RestRequest(); request.Resource = "MachineLocation/{id}.json"; request.AddParameter("id", id, ParameterType.UrlSegment); return JsonStore.Execute(request); } public static MachineLocation Insert(MachineLocation machineLocation) { var request = new RestRequest(Method.PUT); request.Resource = "MachineLocation.json"; request.AddJsonBody(machineLocation); return JsonStore.Execute(request); } public static MachineLocation Update(MachineLocation machineLocation) { var request = new RestRequest(Method.POST); request.Resource = "MachineLocation/{id}.json"; request.AddParameter("id", machineLocation.MachineLocationID, ParameterType.UrlSegment); request.AddJsonBody(machineLocation); return JsonStore.Execute(request); } } }