public static void Create(string name, string slug, long tenantId, EntityContext context) { var tag = new Tag(); tag.Name = name; tag.Slug = slug; tag.TenantId = tenantId; context.AddObject(tag); NotificationUtil.SendAdminEmail(string.Format("New Tag - Name:{0} Slug:{1}", name, slug), ""); }
public static Tag Create(string name, long tenantId, EntityContext context) { var tag = new Tag(); name = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(name.Trim().ToLowerInvariant()); var slug = new Regex("[a-zA-Z_]*").Match(name.Replace(" ", "_")).Value; tag.Name = name.Trim(); tag.Slug = slug; tag.TenantId = tenantId; context.AddObject(tag); NotificationUtil.SendAdminEmail(string.Format("New Tag - Name:{0} Slug:{1}", name, slug), ""); return tag; }
public static string GetHTMLDisplayTag(Tag tag, string type) { return "<span class='skill'>" + MvcHtmlString.Create(tag.Name) + "</span>"; //return string.Format("<a class='skill' href='/Search/Tags/{0}/{1}'>{2}</a>", type, tag.Slug, tag.Name); }