Beispiel #1
0
        public HttpResponseMessage ResetDatabaseToStock()
        {
            var context = new CRMContext();

            context.ResetDatabaseToStock(); // stored proc from SQL server.
            string path     = System.Web.HttpContext.Current?.Request.MapPath("~//reset//index.html");
            var    response = new HttpResponseMessage {
                Content = new StringContent(File.ReadAllText(path))
            };

            response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
            response.StatusCode = HttpStatusCode.OK;
            return(response);
        }