//CRUD public bool AddContentToDirectory(BadgesContent content) { int startingCount = _contentDirectory.Count; _contentDirectory.Add(content); bool wasAdded = (_contentDirectory.Count > startingCount) ? true : false; return(wasAdded); }
public bool UpdateExistingContent(BadgesContent newContent) { var oldContent = _contentDirectory.SingleOrDefault(x => newContent.BadgeID == x.BadgeID); if (oldContent != null) { oldContent.BadgeID = newContent.BadgeID; oldContent.BadgeTitle = newContent.BadgeTitle; oldContent.DoorList = newContent.DoorList; return(true); } else { return(false); } }
public bool DeleteExistingContent(BadgesContent existingContent) { bool deleteResult = _contentDirectory.Remove(existingContent); return(deleteResult); }