Example #1
0
        public string AddWorkspace(WorkspaceModelDto workspaceModelDto)
        {
            var workspaceToSave = mMapper.DtoToWorkspaceModel(workspaceModelDto);

            var createdId = mWorkspaceRepository.Create(workspaceToSave);

            return(createdId);
        }
        public ActionResult <WorkspaceModelDto> UpdateWorkspace(string id, [FromBody] WorkspaceModelDto workspaceModelDto)
        {
            if (id != workspaceModelDto.Id)
            {
                return(BadRequest());
            }
            mAuditLogger.Debug(RetrieveUsername(), ActionEnum.DELETE, ControllerContext.ActionDescriptor.ActionName, HttpStatusCode.OK);
            mWorkspacesFacade.UpdateWorkspace(id, workspaceModelDto);

            return(NoContent());
        }
Example #3
0
        public void UpdateWorkspace(string id, WorkspaceModelDto workspaceModelDto)
        {
            var workspaceModel = mMapper.DtoToWorkspaceModel(workspaceModelDto);

            mWorkspaceRepository.Update(id, workspaceModel);
        }
        public IActionResult AddNewWorkspace([FromBody] WorkspaceModelDto workspaceModelDto)
        {
            var createdId = mWorkspacesFacade.AddWorkspace(workspaceModelDto);

            return(CreatedAtRoute(new { id = createdId }, new { name = workspaceModelDto.Name, id = createdId }));
        }
Example #5
0
 public WorkspaceModel DtoToWorkspaceModel(WorkspaceModelDto dto)
 {
     return(mOurMapper.Map <WorkspaceModel>(dto));
 }