/// <summary> /// Obtiene una coleccion de todos los serviceEntity que cumplen con cierto patron /// </summary> /// <param name="propertyName">propiedad del serviceEntity</param> /// <param name="expValue">patrón de busqueda</param> /// <param name="OperatorType">Tipo de operador de comparación</param> /// <returns>Colección de ServiceEntity</returns> /// <exception cref="ArgumentNullException"> /// Si <paramref name="propertyName"/> es null o vacio. /// <exception cref="ArgumentNullException"> /// Si <paramref name="expValue"/> es null or vacío. /// </exception> /// <exception cref="UtnEmallBusinessLogicException"> /// Si una UtnEmallDataAccessException ocurre en el DataModel. /// </exception> public Collection <ServiceEntity> GetServiceWhere(string propertyName, object expValue, bool loadRelation, OperatorType operatorType) { try { return(serviceDataAccess.LoadWhere(propertyName, expValue, loadRelation, operatorType)); } catch (UtnEmallDataAccessException utnEmallDataAccessException) { throw new UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException); } }
/// <summary> /// Get collection of all serviceEntity that comply with certain pattern /// </summary> /// <param name="propertyName">property of serviceEntity</param> /// <param name="expValue">pattern</param> /// <param name="loadRelation">true to load the relations</param> /// <param name="session">User's session identifier.</param> /// <returns>Collection of ServiceEntity</returns> /// <exception cref="ArgumentNullException"> /// if <paramref name="propertyName"/> is null or empty. /// <exception cref="ArgumentNullException"> /// if <paramref name="expValue"/> is null or empty. /// </exception> /// <exception cref="UtnEmallBusinessLogicException"> /// If an UtnEmallDataAccessException occurs in DataModel. /// </exception> public Collection <ServiceEntity> GetServiceWhere(string propertyName, object expValue, bool loadRelation, OperatorType operatorType, string session) { bool permited = ValidationService.Instance.ValidatePermission(session, "read", "Service"); if (!permited) { ExceptionDetail detail = new ExceptionDetail(new UtnEmall.Server.BusinessLogic.UtnEmallPermissionException("The user hasn't permissions to read an entity")); throw new FaultException <ExceptionDetail>(detail); } try { return(serviceDataAccess.LoadWhere(propertyName, expValue, loadRelation, operatorType)); } catch (UtnEmallDataAccessException utnEmallDataAccessException) { throw new UtnEmall.Server.BusinessLogic.UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException); } }