using RestSharp; using System; using System.Collections.Generic; using Tanshu.Accounts.Entities; namespace Tanshu.Accounts.Repository { public static class RoleBI { public static IList List() { var request = new RestRequest(); request.Resource = "Roles.json"; return JsonStore.Execute>(request); } public static Role Get(Guid id) { var request = new RestRequest(); request.Resource = "Role/{id}.json"; request.AddParameter("id", id, ParameterType.UrlSegment); return JsonStore.Execute(request); } public static IList Permissions() { var request = new RestRequest(); request.Resource = "Permissions.json"; return JsonStore.Execute>(request); } public static Role Update(Role role) { var request = new RestRequest(Method.POST); request.Resource = "Role/{id}.json"; request.AddParameter("id", role.RoleID, ParameterType.UrlSegment); request.AddJsonBody(role); return JsonStore.Execute(request); } } }