/// <summary> /// The GetActionInRole /// </summary> /// <param name="idRole">The idRole<see cref="int"/></param> /// <returns>The <see cref="List{Action}"/></returns> public List <Action> GetActionInRole(int idRole) { List <Action> result = new List <Action>(); List <int> listIdAction = (from a in DbContext.RoleActions where (a.RoleId == idRole && a.IsTrue == true) select a.ActionId).ToList(); foreach (var item in listIdAction) { Action action = (from s in DbContext.Actions where s.ActionId == item select s).FirstOrDefault(); result.Add(action); } return(result); }
/// <summary> /// The EditAction /// </summary> /// <param name="action">The action<see cref="Action"/></param> public bool EditAction(Action action) { return(actionRepository.Update(action)); }
/// <summary> /// The CreateAction /// </summary> /// <param name="action">The action<see cref="Action"/></param> public void CreateAction(Action action) { actionRepository.Add(action); }