public ArchivedTagVersion Archive(IDatabaseContext <Tag> ctx, Tag tag, TagDiff diff, EntryEditEvent reason, string notes = "") { var agentLoginData = ctx.CreateAgentLoginData(PermissionContext); var archived = ArchivedTagVersion.Create(tag, diff, agentLoginData, reason, notes); ctx.OfType <ArchivedTagVersion>().Save(archived); return(archived); }
public async Task <Tag> CreateTagAsync(string englishName) { var tag = new Tag(new LocalizedString(englishName, ContentLanguageSelection.English)); await _ctx.SaveAsync(tag); var archived = ArchivedTagVersion.Create(tag, new TagDiff(), _loginData, EntryEditEvent.Created, string.Empty); await _ctx.SaveAsync(archived); var activityEntry = new TagActivityEntry(tag, EntryEditEvent.Created, _loginData.User, archived); await new ActivityEntryQueries(_ctx.OfType <ActivityEntry>(), null).AddActivityfeedEntryAsync(activityEntry); return(tag); }