public Response <List <UserGroupViewModel> > GetAllUserGroups() { try { var data = _userGroupRepository.GetAllUserGroups(); if (data != null && data.Any()) { return(new Response <List <UserGroupViewModel> >(true, "Success", data)); } return(new Response <List <UserGroupViewModel> >(false, "Fail", null)); } catch (Exception e) { _logger.Error($"GetAllUserGroups Failed: {e.Message}\n {e.StackTrace}"); return(new Response <List <UserGroupViewModel> >(false, e.Message, null)); } }
public List <UserGroup> GetAllUserGroups() { return(ugRepo.GetAllUserGroups()); }