Example #1
0
            //CRUD
            public bool AddContentToDirectory(BadgesContent content)
            {
                int startingCount = _contentDirectory.Count;

                _contentDirectory.Add(content);
                bool wasAdded = (_contentDirectory.Count > startingCount) ? true : false;

                return(wasAdded);
            }
Example #2
0
            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);
                }
            }
Example #3
0
            public bool DeleteExistingContent(BadgesContent existingContent)
            {
                bool deleteResult = _contentDirectory.Remove(existingContent);

                return(deleteResult);
            }