Exemple #1
0
        public async Task DeleteBoard(int boardId, int userId)
        {
            var board = await _db.Boards
                        .Where(b => b.Id == boardId && b.CreatorId == userId)
                        .FirstOrDefaultAsync();

            if (board != null)
            {
                _db.Remove(board);
            }

            await _db.SaveChangesAsync();
        }
Exemple #2
0
        public async Task DeleteRecord(int boardId, int recordId)
        {
            var board = await _db.Records
                        .Where(r => r.Id == recordId && r.BoardId == boardId)
                        .FirstOrDefaultAsync();

            if (board != null)
            {
                _db.Remove(board);
            }

            await _db.SaveChangesAsync();
        }