public override bool Equals(object obj) { if (obj == null) { return(false); } SecurityRisk r = obj as SecurityRisk; if (r as SecurityRisk == null) { return(false); } return(r.Id.Equals(Id) && r.Name.Equals(Name) && r.Description.Equals(Description) && r.SourceOfThreat.Equals(SourceOfThreat) && r.ObjectOfImpact.Equals(ObjectOfImpact) && r.сonfidentialityViolation.Equals(сonfidentialityViolation) && r.integrityViolation.Equals(integrityViolation) && r.availabilityViolation.Equals(availabilityViolation)); }
public static List <SecurityRisk> EnumerateSecurityRisk() { listOfRisks.Clear(); using (var book = new XLWorkbook(DataBase)) { var sheet = book.Worksheets.Worksheet(1); for (int row = 3; row <= sheet.RowsUsed().Count(); ++row) { SecurityRisk securityRisk = new SecurityRisk(); { securityRisk.Id = sheet.Cell(row, 1).Value.ToString(); securityRisk.Name = sheet.Cell(row, 2).Value.ToString(); securityRisk.Description = sheet.Cell(row, 3).Value.ToString(); securityRisk.SourceOfThreat = sheet.Cell(row, 4).Value.ToString(); securityRisk.ObjectOfImpact = sheet.Cell(row, 5).Value.ToString(); securityRisk.ConfidentialityViolation = sheet.Cell(row, 6).Value.ToString(); securityRisk.IntegrityViolation = sheet.Cell(row, 7).Value.ToString(); securityRisk.AvailabilityViolation = sheet.Cell(row, 8).Value.ToString(); }; listOfRisks.Add(securityRisk); } return(listOfRisks); } }