<commit_before>﻿using Persistence.MongoDB;
using SO115App.Models.Servizi.Infrastruttura.GestioneDB;

namespace SO115App.Persistence.MongoDB.GestioneDB
{
    public class ResetDB : IResetDB
    {
        private readonly DbContext _dbContext;

        public ResetDB(DbContext dbContext)
        {
            this._dbContext = dbContext;
        }

        bool IResetDB.Reset()
        {
            try
            {
                if (!_dbContext.DeleteDB("richiesteAssistenza"))
                    return false;

                if (!_dbContext.DeleteDB("chiamateInCorso"))
                    return false;

                if (!_dbContext.DeleteDB("statoMezzo"))
                    return false;

                if (!_dbContext.DeleteDB("statoSquadra"))
                    return false;

                if (!_dbContext.DeleteDB("trasferimentiChiamate"))
                    return false;

                if (!_dbContext.DeleteDB("composizioneMezzi"))
                    return false;

                if (!_dbContext.DeleteDB("composizioneSquadre"))
                    return false;

                if (!_dbContext.DeleteDB("unitaOperative"))
                    return false;

                if (!_dbContext.DeleteDB("squadre"))
                    return false;

                //if (!_dbContext.DeleteDB("emergenza"))
                //    return false;

                //if (!_dbContext.DeleteDB("schedecontatto"))
                //    return false;

                return true;
            }
            catch
            {
                return false;
            }<commit_msg>gestione db<commit_after>﻿using Persistence.MongoDB;
using SO115App.Models.Servizi.Infrastruttura.GestioneDB;

namespace SO115App.Persistence.MongoDB.GestioneDB
{
    public class ResetDB : IResetDB
    {
        private readonly DbContext _dbContext;

        public ResetDB(DbContext dbContext)
        {
            this._dbContext = dbContext;
        }

        bool IResetDB.Reset()
        {
            try
            {
                if (!_dbContext.DeleteDB("richiesteAssistenza"))
                    return false;

                if (!_dbContext.DeleteDB("chiamateInCorso"))
                    return false;

                if (!_dbContext.DeleteDB("statoMezzo"))
                    return false;

                if (!_dbContext.DeleteDB("statoSquadra"))
                    return false;

                if (!_dbContext.DeleteDB("trasferimentiChiamate"))
                    return false;

                if (!_dbContext.DeleteDB("composizioneMezzi"))
                    return false;

                if (!_dbContext.DeleteDB("composizioneSquadre"))
                    return false;

                if (!_dbContext.DeleteDB("unitaOperative"))
                    return false;

                if (!_dbContext.DeleteDB("squadre"))
                    return false;

                if (!_dbContext.DeleteDB("concorrenza"))
                    return false;

                //if (!_dbContext.DeleteDB("emergenza"))
                //    return false;

                //if (!_dbContext.DeleteDB("schedecontatto"))
                //    return false;

                return true;
            }
            catch
            {
                return false;
            }
{'fraction_non_alphanumeric': 0.08878787878787879, 'fraction_numerical': 0.0036363636363636364, 'mean_word_length': 1.311624649859944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1371440', 'n_tokens_mistral': 905, 'n_tokens_neox': 804, 'n_words': 147}