public static List <T> Siblings <T>(this BaseModel n, bool currentLanguage = true, bool noCast = false, bool ExplicitType = false) where T : BaseModel { var qh = new QueryHelper <T>(); qh .And() //.Field(x => x.Path, ApiHelper.DirOfPath(n.Path.ToLower()).WildCardMulti()) .Path(ApiHelper.DirOfPath(n.Path.ToLower()).WildCardMulti()) .Not() //.Field(x => x.Path, ApiHelper.DirOfPath(n.Path.ToLower()).WildCardMulti() + "/*") .Path(ApiHelper.DirOfPath(n.Path.ToLower()).WildCardMulti() + "/*") .Not() .Field(x => x.Id, n.Id.ToString().Wrap()); if (ExplicitType) { qh.ExplicitType(); } if (currentLanguage) { qh.CurrentLanguage(); } if (noCast) { return(qh.GetAllNoCast()); } else { return(qh.GetAll()); } }
public QueryHelper <TModel> Siblings(string path, string id) { TrimAnd(); this .And() //.Field(x => x.Path, ApiHelper.DirOfPath(path.ToLower()).WildCardMulti()) .Path(ApiHelper.DirOfPath(path.ToLower()).WildCardMulti()) .Not() //.Field(x => x.Path, ApiHelper.DirOfPath(path.ToLower()).WildCardMulti() + "/*") .Path(ApiHelper.DirOfPath(path.ToLower()).WildCardMulti() + "/*") .Not() .Field(x => x.Id, id.Wrap()); return(this); }