private void OwnedTypeCannotHaveASubclass(ValidationContext context) { if (ModelRoot == null) { return; } if (IsDependentType && Subclasses.Any()) { context.LogError($"Can't make {Name} a dependent class since it has subclass(es) {string.Join(", ", Subclasses.Select(s => s.Name))}", "MCEOwnedHasSubclass", this); } }
public bool ContainsText(string query) { // if the query is empty, return true if (string.IsNullOrEmpty(query) || string.IsNullOrWhiteSpace(query)) { return(true); } // if the query is not empty test return ((!string.IsNullOrEmpty(Markdown) && Markdown.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0) || Subclasses.Any(s => s.ContainsText(query))); }