Ejemplo n.º 1
0
        public HttpResponseMessage ResetTheUniverse()
        {
            try
            {
                var directoryInfo = new DirectoryInfo(_appDataFolder);
                directoryInfo.GetFiles().ToList().ForEach(queryFile => queryFile.Delete());
                _inventoryRepo.InitializeData(_connectionContext);

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Failed to reset the universe"));
            }
        }