private static bool CheckIfNameExists(string name) { if (CustomProperties.Any(p => 0 == string.Compare(p.Name, name, StringComparison.OrdinalIgnoreCase)) || typeof(T).GetProperties().Any(p => 0 == string.Compare(p.Name, name, StringComparison.OrdinalIgnoreCase))) { throw new Exception("Property with this name already exists: " + name); } return(false); }