Carrotware.CMS.Core.ContentSnippet.GetSnippetBySlug C# (CSharp) Method

GetSnippetBySlug() public static method

public static GetSnippetBySlug ( System.Guid siteID, string categorySlug, bool bActiveOnly ) : ContentSnippet
siteID System.Guid
categorySlug string
bActiveOnly bool
return ContentSnippet
        public static ContentSnippet GetSnippetBySlug(Guid siteID, string categorySlug, bool bActiveOnly)
        {
            ContentSnippet _item = null;
            using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
                vw_carrot_ContentSnippet query = CompiledQueries.GetLatestContentSnippetBySlug(_db, siteID, bActiveOnly, categorySlug);
                if (query != null) {
                    _item = new ContentSnippet(query);
                }
            }

            return _item;
        }