public bool TryResolveType <T>(string name, string @namespace, out T type) where T : OdcmType { string canonicalName = OdcmObject.MakeCanonicalName(name, @namespace); var odcmType = _Types.FirstOrDefault(t => t.CanonicalName().Equals(canonicalName, StringComparison.InvariantCulture)); type = odcmType as T; return(type != null); }
public bool TryResolveType <T>(string name, string @namespace, out T type) where T : OdcmType { string canonicalName = OdcmObject.MakeCanonicalName(name, @namespace); foreach (OdcmType candidate in _Types) { if (candidate.CanonicalName().Equals(canonicalName, StringComparison.InvariantCulture)) { type = candidate as T; return(true); } } type = null; return(false); }