private static void addTagToTopic(int topicId, Tag tag) { var db = new Database("umbracoDbDSN"); if (tag.Id == 0) { db.Insert(tag); } var topicTag = db.SingleOrDefault <TopicTag>("WHERE tagId = @0 and topicId = @1", tag.Id, topicId); if (topicTag == null) { topicTag = new TopicTag(tag.Id, topicId, tag.Weight); db.Insert(topicTag); } }
private static void addTagToTopic(int topicId, Tag tag) { var db = new Database("umbracoDbDSN"); if (tag.Id == 0) { db.Insert(tag); } var topicTag = db.SingleOrDefault<TopicTag>("WHERE tagId = @0 and topicId = @1", tag.Id, topicId); if (topicTag == null) { topicTag = new TopicTag(tag.Id, topicId, tag.Weight); db.Insert(topicTag); } }