public async Task <ActionResult <ReconServers> > ReconServers(ReconServers recon) { try { await new ReconciliationData().ReconciliationServers(recon); _logger.LogInformation($"The data have been accepted for user: {_userEx} (ReconServers)."); } catch (System.Exception ex) { _logger.LogError($"An error has occurred during data processing. For : {_userEx}. Error : {ex.Message}"); return(StatusCode(500, $"An error has occurred during data processing. For : {_userEx}. Error : {ex.Message}")); } return(Ok(new { message = "The data have been accepted" })); }
/// <summary> /// Reconciliation of data for servers. /// </summary> /// <param name="item"></param> public async Task ReconciliationServers(ReconServers item) { var recon = new Servers { ServerExId = item.ServerExId, Name = item.Name, Host = item.Host, CountryRegionCode = item.CountryRegionCode, Model = item.Model, SerialNumber = item.SerialNumber, WarrantyExpirationDate = item.WarrantyExpirationDate, Cputype = item.Cputype, Ram = item.Ram, HardDisk = item.HardDisk, Ups = item.Ups, AntivirusSoftware = item.AntivirusSoftware }; _context.Servers.Add(recon); await _context.SaveChangesAsync(); }