public virtual string GetExceptionNameIfExist(IType type, bool needsQuote) { CompositeType compType = type as CompositeType; if (compType != null) { if (ServiceClient.ErrorTypes.Contains(compType)) { if (needsQuote) { return(", '" + compType.GetExceptionDefineType() + "'"); } return(", " + compType.GetExceptionDefineType()); } } return(string.Empty); }
public static string GetExceptionDefinitionTypeIfExists(this CompositeType type, CodeModel serviceClient) { if (type == null) { throw new ArgumentNullException("type"); } if (serviceClient == null) { throw new ArgumentNullException("serviceClient"); } if (serviceClient.ErrorTypes.Contains(type)) { return(type.GetExceptionDefineType()); } else { return(null); } }