/// <summary> /// Gets the site content for given site id. /// </summary> /// <param name="id">Site id</param> /// <typeparam name="T">The site model type</typeparam> /// <returns>The site content model</returns> public static T GetContentById <T>(this SiteService service, Guid id) where T : SiteContent <T> { return(service.GetContentByIdAsync <T>(id).GetAwaiter().GetResult()); }
/// <summary> /// Gets the hierachical sitemap structure. /// </summary> /// <param name="id">The optional site id</param> /// <param name="onlyPublished">If only published items should be included</param> /// <returns>The sitemap</returns> public static Sitemap GetSitemap(this SiteService service, Guid?id = null, bool onlyPublished = true) { return(service.GetSitemapAsync(id, onlyPublished).GetAwaiter().GetResult()); }
/// <summary> /// Gets the default side. /// </summary> /// <returns>The modell, or NULL if it doesnt exist</returns> public static Site GetDefault(this SiteService service) { return(service.GetDefaultAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets the site content for given site id. /// </summary> /// <param name="id">Site id</param> /// <returns>The site content model</returns> public static DynamicSiteContent GetContentById(this SiteService service, Guid id) { return(service.GetContentByIdAsync(id).GetAwaiter().GetResult()); }
/// <summary> /// Gets the model with the given internal id. /// </summary> /// <param name="internalId">The unique internal i</param> /// <returns>The model</returns> public static Site GetByInternalId(this SiteService service, string internalId) { return(service.GetByInternalIdAsync(internalId).GetAwaiter().GetResult()); }
/// <summary> /// Gets the model with the given hostname. /// </summary> /// <param name="hostname">The hostname</param> /// <returns>The model</returns> public static Site GetByHostname(this SiteService service, string hostname) { return(service.GetByHostnameAsync(hostname).GetAwaiter().GetResult()); }
/// <summary> /// Gets the model with the specified id. /// </summary> /// <param name="id">The unique id</param> /// <returns>The model, or null if it doesn't exist</returns> public static Site GetById(this SiteService service, Guid id) { return(service.GetByIdAsync(id).GetAwaiter().GetResult()); }
/// <summary> /// Gets all available models. /// </summary> /// <returns>The available models</returns> public static IEnumerable <Site> GetAll(this SiteService service) { return(service.GetAllAsync().GetAwaiter().GetResult()); }
/// <summary> /// Deletes the given model. /// </summary> /// <param name="model">The model</param> public static void Delete(this SiteService service, Site model) { service.DeleteAsync(model).GetAwaiter().GetResult(); }
/// <summary> /// Deletes the model with the specified id. /// </summary> /// <param name="id">The unique id</param> public static void Delete(this SiteService service, Guid id) { service.DeleteAsync(id).GetAwaiter().GetResult(); }
/// <summary> /// Saves the given site content to the site with the /// given id. /// </summary> /// <param name="siteId">The site id</param> /// <param name="model">The site content model</param> /// <typeparam name="T">The site content type</typeparam> public static void SaveContent <T>(this SiteService service, Guid siteId, T model) where T : SiteContent <T> { service.SaveContentAsync(siteId, model).GetAwaiter().GetResult(); }