public BoardModel CreateNewBoard(BoardCreateOrEditModel newBoard) { var currUser = base.CurrentUser(); var boardToCreate = new Board() { PartitionKey = currUser.RowKey, RowKey = GetNewShortGuid(), Name = newBoard.name, UrlName = newBoard.name.Slugify(), Description = newBoard.description, CreatedBy = currUser.UserName, CreatedAt = DateTime.Now, UpdatedBy = currUser.UserName, UpdatedAt = DateTime.Now, }; _boardRepository.AddOrUpdateEntity(boardToCreate); return new BoardModel() { id = boardToCreate.RowKey }; }
public void UpdateBoard(BoardCreateOrEditModel board) { var user = CurrentUser(); var storageBoard = _boardRepository.Query .Where(b => b.PartitionKey == user.RowKey && b.RowKey == board.id).FirstOrDefault(); storageBoard.Name = board.name; storageBoard.UrlName = board.name.Slugify(); storageBoard.Description = board.description; storageBoard.UpdatedBy = user.UserName; storageBoard.UpdatedAt = DateTime.Now; //send notifications _notificationManager.AlertBoardUpdate(storageBoard, user); _boardRepository.AddOrUpdateEntity(storageBoard); }