public static IcbcodeContent Get(string content_url, string domain) { IcbcodeContent item = null; using (ContentRepository content_repository = new ContentRepository()) { item = IcbcodeContent.Convert(content_repository.GetActiveByUrl(content_url.TrimEnd('/'), domain ?? _Domain), 1, 1); } return(item); }
public static IcbcodeContent Get(long content_id) { IcbcodeContent item = null; using (ContentRepository content_repository = new ContentRepository()) { item = IcbcodeContent.Convert(content_repository.GetActiveByID(content_id), 1, 1); } return(item); }
private static IcbcodeCollection <IcbcodeContent> Get(long[] content_root, string[] block_name, string[] template_name, string order_fields, long page, long size, string query, dynamic where, string domain) { IcbcodeCollection <IcbcodeContent> items = new IcbcodeCollection <IcbcodeContent>(); long totals; using (ContentRepository content_repository = new ContentRepository()) { List <dynamic> contents = content_repository.GetActive(block_name, content_root, template_name, order_fields, page, size, out totals, query, where, domain); items.TotalPages = totals; items.CurrentPage = page; items.PageSize = size; for (int index = 0; index < contents.Count; index++) { items.Add(IcbcodeContent.Convert(contents[index], index + 1, contents.Count)); } } return(items); }
public IcbcodeCollection <IcbcodeContent> Childs(string[] template_name = null, string order_fields = null, long page = 1, long size = Int64.MaxValue, string query = null, dynamic where = null, string domain = null) { IcbcodeCollection <IcbcodeContent> items = new IcbcodeCollection <IcbcodeContent>(); long totals; using (ContentRepository content_repository = new ContentRepository()) { List <dynamic> contents = content_repository.GetActive(null, new long[] { ID }, template_name, order_fields, page, size, out totals, query, where, domain); items.TotalPages = totals; items.CurrentPage = page; items.PageSize = size; for (int index = 0; index < contents.Count; index++) { items.Add(IcbcodeContent.Convert(contents[index], index + 1, contents.Count)); } } return(items); }