public bool AddContentToDirectory(GreenContent content) { int startingCount = _contentDirectory.Count; _contentDirectory.Add(content); bool wasAdded = (_contentDirectory.Count > startingCount) ? true : false; return(wasAdded); }
public bool UpdateExistingContent(string originalTitle, GreenContent newContent) { GreenContent oldContent = GetContentByTitle(originalTitle); if (oldContent != null) { oldContent.CarName = newContent.CarName; oldContent.MileageToRefill = newContent.MileageToRefill; oldContent.YearMade = newContent.YearMade; oldContent.CarPrice = newContent.CarPrice; oldContent.CarType = newContent.CarType; return(true); } else { return(false); } }
public bool DeleteExistingContent(GreenContent existingContent) { bool deleteResult = _contentDirectory.Remove(existingContent); return(deleteResult); }