/// <summary> /// Obtiene un serviceEntity específico /// </summary> /// <param name="id">id del ServiceEntity a cargar</param> /// <param name="loadRelation">true para cargar las relaciones</param> /// <returns>Un ServiceEntity</returns> /// <exception cref="ArgumentNullException"> /// Si <paramref name="serviceEntity"/> is null. /// </exception> /// <exception cref="UtnEmallBusinessLogicException"> /// Si una excepción UtnEmallDataAccessException ocurre en el data model. /// </exception> public ServiceEntity GetService(int id, bool loadRelation) { try { return(serviceDataAccess.Load(id, loadRelation)); } catch (UtnEmallDataAccessException utnEmallDataAccessException) { throw new UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException); } }
/// <summary> /// Get an specific serviceEntity /// </summary> /// <param name="id">id of the ServiceEntity to load</param> /// <param name="loadRelation">true to load the relations</param> /// <param name="session">User's session identifier.</param> /// <returns>A ServiceEntity</returns> /// <exception cref="ArgumentNullException"> /// if <paramref name="serviceEntity"/> is null. /// </exception> /// <exception cref="UtnEmallBusinessLogicException"> /// If an UtnEmallDataAccessException occurs in DataModel. /// </exception> public ServiceEntity GetService(int id, bool loadRelation, 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.Load(id, loadRelation)); } catch (UtnEmallDataAccessException utnEmallDataAccessException) { throw new UtnEmall.Server.BusinessLogic.UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException); } }