public static T ObtenerResultado <T>(IOperationResult <T> result) { if (result.HasNoException) { return(result.Value); } if (result.HasFaultExceptionOfType <Exception>()) { throw new Exception(ObtenerMensajeError(result)); //FaultException(Type) } if (result.HasFaultException) { throw new Exception(); //Exception FaultException } throw new Exception(""); //Exception Generica }
public static void FinalizarResultado(IOperationResult result) { if (result.HasNoException) { return; } if (result.HasFaultExceptionOfType <Exception>()) { throw new Exception(ObtenerMensajeError(result)); //FaultException(Type) } if (result.HasFaultException) { throw new Exception(); //Exception FaultException } throw new Exception(""); //Exception Generica }