public void AddRecordToRepo(LandingSite ls) { if (ls == null) { throw new ArgumentNullException("Error: The argument is Null"); } LandingSiteCollection.Add(ls); }
public bool AddRecordToRepo(LandingSite ls) { if (ls == null) { throw new ArgumentNullException("Error: The argument is Null"); } LandingSiteCollection.Add(ls); return(_editSuccess); }
public void DeleteRecordFromRepo(LandingSite ls) { if (ls == null) { throw new Exception("Landing site cannot be null"); } int index = 0; while (index < LandingSiteCollection.Count) { if (LandingSiteCollection[index].ID == ls.ID) { LandingSiteCollection.RemoveAt(index); break; } index++; } }
public void DeleteRecordFromRepo(string id) { if (id == null) { throw new Exception("Record ID cannot be null"); } int index = 0; while (index < LandingSiteCollection.Count) { if (LandingSiteCollection[index].LandingSiteID == id) { LandingSiteCollection.RemoveAt(index); break; } index++; } }
public LandingSite GetLandingSite(int id) { return(LandingSiteCollection.FirstOrDefault(t => t.ID == id)); }
public List <LandingSite> GetAll() { return(LandingSiteCollection.OrderBy(t => t.Name).ToList()); }
public List <LandingSite> GetAllLandingSites() { return(LandingSiteCollection.ToList()); }
public LandingSite GetLandingSite(string landingSiteID) { return(LandingSiteCollection.FirstOrDefault(n => n.LandingSiteID == landingSiteID)); }