/// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int DeleteDetail(SaveDetailModels model)
        {
            int        countOfDetailDeleted = 0;
            SaveDetail saveDetail           = _db.SaveDetails.FirstOrDefault(x => x.Id == model.Id);

            if (saveDetail != null)
            {
                _db.SaveDetails.Remove(saveDetail);
                countOfDetailDeleted = _db.SaveChanges();
            }
            return(countOfDetailDeleted);
        }
        public int AddDetail(SaveDetailModels model)
        {
            SaveDetail saveDetail = new SaveDetail();

            saveDetail.Name      = model.Name;
            saveDetail.Continent = model.ContinentId;
            saveDetail.Country   = model.CountryId;
            saveDetail.City      = model.CityId;
            saveDetail.Remember  = model.Remember ?? false;
            _db.SaveDetails.Add(saveDetail);
            int countOfDetailSaved = _db.SaveChanges();

            return(countOfDetailSaved);
        }
        public int UpdateDetail(SaveDetailModels model)
        {
            int        countOfDetailUpdated = 0;
            SaveDetail saveDetail           = _db.SaveDetails.FirstOrDefault(x => x.Id == model.Id);

            if (saveDetail != null)
            {
                saveDetail.Name      = model.Name;
                saveDetail.Continent = model.ContinentId;
                saveDetail.Country   = model.CountryId;
                saveDetail.City      = model.CityId;
                saveDetail.Remember  = model.Remember;
                countOfDetailUpdated = _db.SaveChanges();
            }
            return(countOfDetailUpdated);
        }