コード例 #1
0
        //public ActionResult test(Guid id)
        //{

        //    var user = new Users() { id = id };

        //    var users = new ScoopLinq<Users>()
        //        .Where(x =>
        //            x.created == new DateTime(2017, 03, 29, 09, 02, 16, 793) ||
        //            x.id == user.id ||
        //            x.IsActive == false ||
        //            x.id == new Guid("b8ae6bc9-8739-4a2f-be17-a49fd432d42a") ||
        //            x.id.Equals(new Guid("b8ae6bc9-8739-4a2f-be17-a49fd432d42a")) ||
        //           !string.IsNullOrEmpty(x.UserEmail) ||
        //           x.IsActive != null ||
        //           x.IsActive == null
        //        ).RunToList();



        //    return View();
        //}
        //public List<Users> GetUser()
        //{
        //    var cacheKey = "User";
        //    List<Users> currencyData = _repository.Cache.Get(cacheKey) as List<Users>;
        //    if (currencyData == null)
        //    {
        //        //DB den veri burda çekilecek
        //        currencyData = new ScoopLinq<Users>().Where(x => x.id == new Guid("85F2339A-3063-452D-A86B-76190175780C")).RunToList().ToList();
        //        if (currencyData.Any())
        //        {
        //            var cachedTimeOut = System.Web.Configuration.WebConfigurationManager.AppSettings["CachedTimeOut"];
        //            var time = !string.IsNullOrEmpty(cachedTimeOut) ? int.Parse(cachedTimeOut) : 30;
        //            _repository.Cache.Set(cacheKey, currencyData, time);
        //        }
        //    }
        //    return currencyData;
        //}

        public ActionResult DatabaseBackup()
        {
            var feedBack = new FeedBack();
            var fileRS   = ScoopFiles.GetDBScript(null);

            if (fileRS.Success)
            {
                feedBack.Success("Veri Tabanı Yedekleme İşlemi Başarılı", true);
                return(base.File(fileRS.Data.ToString(), ".zip"));
            }

            feedBack.Warning("Veri Tabanı Yedekleme İşlemi Başarısız", true);
            return(Redirect(Url.Action("Index", "Home")));
        }