コード例 #1
0
ファイル: ModelClass.cs プロジェクト: dcastenholz/EFDesigner
 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)));
 }