コード例 #1
0
        internal Whiteboard GetById(int id)
        {
            Whiteboard data = _repo.GetById(id);

            if (data == null)
            {
                throw new Exception("Invalid id");
            }
            return(data);
        }
コード例 #2
0
        internal string Create(Stickynote pm)
        {
            Whiteboard whiteboard = _whiteboardsrepo.GetById(pm.WhiteboardId);

            if (whiteboard == null)
            {
                throw new Exception("Not a valid whiteboard");
            }
            if (whiteboard.CreatorId != pm.CreatorId)
            {
                throw new Exception("You are not the owner of this whiteboard");
            }
            _repo.Create(pm);
            return("Created");
        }