public static IList <Operacion> GetOperaciones() { IList <Operacion> operaciones = new List <Operacion>(); operaciones = AdministracionMapper.GetOperaciones(); return(operaciones); }
public static void SaveRoleOperaciones(Role role, IList <int> operationsIDs) { IList <Operacion> operaciones = AdministracionMapper.GetOperaciones(); IList <Operacion> operacionesRole = new List <Operacion>(); foreach (var idOperacion in operationsIDs) { var operacion = operaciones.FirstOrDefault(m => m.Id.Equals(idOperacion)); if (operacion == null) { throw new HandleException("La operación ingresada no existe"); } operacionesRole.Add(operacion); } role.Operaciones = new System.Collections.ObjectModel.ReadOnlyCollection <Operacion>(operacionesRole); AdministracionMapper.SaveRoleOperaciones(role); }