Пример #1
0
        public async Task Delete(ISiteSettings site)
        {
            await _eventHandlers.HandleSitePreDelete(site.Id).ConfigureAwait(false);

            // delete users
            await _userCommands.DeleteUsersBySite(site.Id, CancellationToken.None); // this also deletes userroles claims logins

            await _userCommands.DeleteRolesBySite(site.Id, CancellationToken.None);

            await _commands.DeleteHostsBySite(site.Id, CancellationToken.None);

            //resultStep = await siteRepo.DeleteFoldersBySite(site.SiteGuid, CancellationToken.None);


            // the below method deletes a lot of things by siteid including the following tables
            // Exec mp_Sites_Delete
            // mp_UserRoles
            // mp_UserProperties
            // mp_UserLocation
            // mp_Users
            // mp_Roles
            // mp_SiteHosts
            // mp_SiteFolders
            // mp_SiteSettingsEx
            // mp_Sites

            await _commands.Delete(site.Id, CancellationToken.None);

            _cacheHelper.ClearCache("folderList");
        }
Пример #2
0
        public async Task Delete(ISiteSettings site)
        {
            await _eventHandlers.HandleSitePreDelete(site.Id).ConfigureAwait(false);

            // delete users
            await _userCommands.DeleteUsersBySite(site.Id, CancellationToken.None); // this also deletes userroles claims logins

            await _userCommands.DeleteRolesBySite(site.Id, CancellationToken.None);

            await _commands.DeleteHostsBySite(site.Id, CancellationToken.None);

            await _commands.Delete(site.Id, CancellationToken.None);

            await _cacheHelper.ClearSiteFolderListCache();
        }