Example #1
0
        public Models.SaveResponse Log([FromBody] Models.MessageLogModel request)
        {
            var repo = new DataLib.Repository();
            var app  = repo.GetApplication(request.Application_Id);

            if (app == null)
            {
                return new Models.SaveResponse()
                       {
                           Success = false
                       }
            }
            ;

            var log = new DataLib.Models.MessageModel()
            {
                Logger         = request.Logger,
                Level          = request.Level,
                Application_Id = request.Application_Id,
                Message        = request.Message
            };

            repo.InsertMessageLog(log);
            return(new Models.SaveResponse()
            {
                Success = true
            });
        }
    }
Example #2
0
        public void LogMessageTest()
        {
            var appTest = new ApplicationTest();
            var app     = appTest.InsertApplication();

            DataLib.Repository repo = new DataLib.Repository();
            var log = new MessageModel()
            {
                Application_Id = app.Application_Id,
                Logger         = "UnitTest",
                Message        = "Unit Tested.",
                Level          = "Test"
            };

            repo.InsertMessageLog(log);
        }