Example #1
0
        public async Task <bool> SaveError(ErrorPoco eo)
        {
            try
            {
                var dbItem = ConvertPocoToDb(eo);

                if (eo.Id == null)
                {
                    await _repo.InsertErrorItem(dbItem);
                }
                else
                {
                    await _repo.UpdateErrorItem(dbItem);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Logging.WriteToAppLog("Error saving SiteError object to DB: " + ex.Message, EventLogEntryType.Error);
                return(false);
            }
        }
Example #2
0
 private ErrorLog ConvertPocoToDb(ErrorPoco item)
 {
     return(JsonConvert.DeserializeObject <ErrorLog>(JsonConvert.SerializeObject(item)));
 }
 public async Task <bool> SaveError(ErrorPoco eo)
 {
     return(await _mgr.SaveError(eo));
 }