Beispiel #1
0
        public async Task InvokeAsync(HttpContext httpContext, DAL.IDbService service)
        {
            if (httpContext.Request != null)
            {
                string sciezka     = httpContext.Request.Path; //"weatherforecast/cos"
                string querystring = httpContext.Request?.QueryString.ToString();
                string metoda      = httpContext.Request.Method.ToString();
                string bodyStr     = "";

                using (StreamReader reader
                           = new StreamReader(httpContext.Request.Body, Encoding.UTF8, true, 1024, true))
                {
                    bodyStr = await reader.ReadToEndAsync();
                }
                string fileString = "";
                fileString += metoda;
                fileString += " " + sciezka;
                fileString += " " + bodyStr;
                fileString += " " + querystring;
                string   logFile = @"logginFile.txt";
                FileInfo f       = new FileInfo(logFile);
                try
                {
                    StreamWriter logStream = new StreamWriter(f.OpenWrite());
                    logStream.Write(fileString);
                    logStream.Close();
                }
                catch (Exception e) {}
            }

            await _next(httpContext);
        }
Beispiel #2
0
 public CukierniaController(DAL.IDbService dbService)
 {
     _dbService = dbService;
 }
Beispiel #3
0
 public DoctorsController(DAL.IDbService dbService)
 {
     _dbService = dbService;
 }