Skip to content

Instantly share code, notes, and snippets.

@rhysgodfrey
Created June 14, 2016 15:19
Show Gist options
  • Save rhysgodfrey/bf50405b550048dd185dbcc45d012fda to your computer and use it in GitHub Desktop.
Save rhysgodfrey/bf50405b550048dd185dbcc45d012fda to your computer and use it in GitHub Desktop.
var urls = Telligent.Evolution.Extensibility.Api.Version1.PublicApi.Url;
var blogs = Telligent.Evolution.Extensibility.Api.Version1.PublicApi.Blogs;
var context = urls.CurrentContext;
var blogInfo = context.ContextItems.Find(item => item.ContentTypeId == blogs.ContentTypeId);
if (blogInfo == null || !blogInfo.ContentId.HasValue)
{
// No current blog - do something
throw new Exception();
}
var blog = blogs.Get(blogInfo.ContentId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment