public void CleanUpAllgroupsIds() { using (RepoLock.ReaderLock()) { List <SVR_GroupFilter> series = IsCached ? Cache.Values.ToList() : Table.ToList(); ShokoContext ctx = Provider.GetContext(); ctx.AttachRange(series); series.ForEach(a => a.GroupsIdsString = null); ctx.SaveChanges(); } }
public void KillEmAll() { using (RepoLock.ReaderLock()) { List <SVR_AnimeGroup_User> grps; if (IsCached) { grps = Cache.Values.ToList(); Cache = null; ClearIndexes(); } else { grps = Table.ToList(); } ShokoContext ctx = Provider.GetContext(); ctx.AttachRange(grps); ctx.RemoveRange(grps); ctx.SaveChanges(); } }