/// <summary> /// Checks if type has circular dependencies. /// </summary> /// <param name="t"></param> /// <returns></returns> private bool AnyCircularDependencies(Type t) { if (ContainsCircularDependencies(t)) { return(true); } var fields = t.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); foreach (var field in fields) { if (!DefaultValuesProvider.IsSupportedType(field.FieldType)) { if (!t.Assembly.IsMicrosoftAssembly()) { dtoDependencies.Push(t); if (AnyCircularDependencies(field.FieldType)) { return(true); } dtoDependencies.Pop(); } } } return(false); }
private bool IsDto(Type t) { if (DefaultValuesProvider.IsSupportedType(t)) { return(false); } if (t.Assembly.IsMicrosoftAssembly()) { return(false); } return(true); }