Esempio n. 1
0
        public async Task <ActionResult> Create(IFormFile spots)
        {
            // Validate spots file
            if (spots.Length == 0)
            {
                return(BadRequest());
            }
            else
            {
                var cacheEntryOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(60));
                _cache.Set("FormFile", spots, cacheEntryOptions);

                ThreadPool.QueueUserWorkItem(
                    (obj) =>
                {
                    _uploadRespository.UploadSpots(spots);
                }

                    );

                return(Accepted("Spots save validated and started"));
            }
        }