Exemplo n.º 1
0
        // GET: UserGroups/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserGroupViewModel userGroup = Mapper.Map <UserGroupViewModel>(userGroupService.Get(id.Value));

            if (userGroup == null)
            {
                return(HttpNotFound());
            }
            return(View(userGroup));
        }
        public IResponseData <GetUserGroupResponse> GetRole(Guid id)
        {
            IResponseData <GetUserGroupResponse> response = new ResponseData <GetUserGroupResponse>();

            try
            {
                IUserGroupService    service = IoC.Container.Resolve <IUserGroupService>();
                GetUserGroupResponse role    = service.Get(id);
                response.SetData(role);
            }
            catch (ValidationException ex)
            {
                response.SetErrors(ex.Errors);
                response.SetStatus(System.Net.HttpStatusCode.PreconditionFailed);
            }
            return(response);
        }
Exemplo n.º 3
0
 public IActionResult Get()
 {
     return(Ok(_userGroupService.Get()));
 }
        public GetUserGroupResponse GetRole(Guid id)
        {
            IUserGroupService service = IoC.Container.Resolve <IUserGroupService>();

            return(service.Get(id));
        }