public void InsertExceptionLog() { var repository = new CustomerRepositoryHelper(); var exc = new SPCServices.ExceptionHandling.ExceptionObj { LicenseId = "aasdasd", Environment = "Environment", OsEdition = "OsEdition", OsName = "OsName", OSBits = "OsBits" }; Console.WriteLine(repository.InsertExceptionLog(exc)); }
/// <summary> /// Create New Logs /// </summary> public Boolean InsertExceptionLog(SPCServices.ExceptionHandling.ExceptionObj onewEx) { var exceptionLog = new ExceptionLog { LicenseId = onewEx.LicenseId, Environment = onewEx.Environment, Type = onewEx.Type, RemoteIp = onewEx.remoteIP, Exception = onewEx.Exception, OsName = onewEx.OsName, OsEdition = onewEx.OsEdition, Sp = onewEx.SP, Processor = onewEx.Processor, Osbits = onewEx.OSBits, SpcAppVersion = onewEx.SPCAppVersion, Browser = onewEx.Browser, BrowserVersion = onewEx.BrowserVersion, Created = DateTime.UtcNow, Updated = DateTime.UtcNow, Version = "1.0" }; using (var context = new CustomerInfoRepository()) { context.ExceptionLogs.Add(exceptionLog); try { context.SaveChanges(); return(true); } catch (Exception) { return(false); } } }