예제 #1
0
 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);
     }
 }
예제 #2
0
 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)));
 }