public void AddBoard(string username, string boardname, string description, bool isPublic)
 {
     var id = _idGen++;
     var b = new Board(boardname, description, id);
     var registery = new Registery(b, username, isPublic);
     _regist.Add(id, registery);
 }
 public Registery(Board b, string username, bool canView)
 {
     IsPublic = canView;
     Author = username;
     Users = new List<UserProperty>();
     Users.Add(new UserProperty(username,true));
       //  IsPublic = canContribute;
     Board = b;
 }
 public static BoardShow Convert(Board b, bool isPublic, bool isEditable)
 {
     return new BoardShow
     {
         IsEditable = isEditable,
         List = b.Lists.Select(list => Convert(list,isEditable)),
         Name = b.Name,
         Description = b.Description,
         IsPublic = isPublic,
         Id = b.BoardId
     };
 }
 public BoardList GetBListFromBoard(Board board, string listname)
 {
     return board.Lists.FirstOrDefault(list => list.Name.Equals(listname));
 }
 private BoardList GetList(Board b, int id)
 {
     return b.Lists.Get(id);
 }
        public void RemoveCardFromBoard(Board board, int cardId, int listId)
        {
            var list = GetListFromBoard(board,listId);
            var card = GetEntryFromBoard(board, cardId);

            list.Remove(list.GetIndexFor(card));
            board.Archived.Add(card.Id,card);
        }
 public IndexedList<BoardCard> GetListFromBoard(Board board, int listId)
 {
     return GetListFromBoard(board)[listId];
 }
 public Dictionary<int, IndexedList<BoardCard>> GetListFromBoard(Board b)
 {
     return b.Lists.ToDictionary(blist => blist.Id, blist => blist.Cards);
 }
        //AUXILIARY METHOD
        public int GetIdOfListWhereCardIs(Board b, int cardId)
        {
            var lists = GetListFromBoard(b);

            return lists.FirstOrDefault(pair => pair.Value.Select(elements => elements.Id).Contains(cardId)).Key;
        }
        public BoardCard GetEntryFromBoard(Board board, int id)
        {
            BoardCard outValue;
            board.Cards.TryGetValue(id, out outValue);

            return outValue;
        }