public async static void Log(ErrorLevel level, Exception e = null, string message = null) { ErrorLog log; if (e != null) log = new ErrorLog(e, message); else if (message != null) log = new ErrorLog(message); else throw new ArgumentException("Both parameters cannot be null!", "e"); await ExternalApi.Post<bool>(ConfigUtilities.GetString("ErrorLogUrl"), log); }
//POST: /api/ErrorApi public void Post(ErrorLog log) { using (var db = new VideoQuizRepository<ErrorLog>()) db.Add(log); }