Example #1
0
        public async Task <bool> Delete(ISiteSettings site)
        {
            // we will need a provider model or something similar here to
            // allow other features and 3rd party features to delete
            // related data when a site is deleted
            // TODO: implement
            // will ProviderModel be available in Core Framework or will we have to use something else
            // a way to use dependency injection?

            // delete users
            bool resultStep = await userRepo.DeleteUsersBySite(site.SiteId, CancellationToken.None); // this also deletes userroles claims logins

            resultStep = await userRepo.DeleteRolesBySite(site.SiteId, CancellationToken.None);

            resultStep = await siteRepo.DeleteHostsBySite(site.SiteId, 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

            return(await siteRepo.Delete(site.SiteId, CancellationToken.None));
        }