public Guid AddEmptyLevel(Guid topicId, EmptyLevelDTO level) { var client = new RestClient(serverUri + $"/service/{topicId}/level"); var request = new RestRequest(Method.POST); request.AddJsonBody(level); var content = client.Execute(request); var levelId = JsonConvert.DeserializeObject <Guid>(content.Content); return(levelId); }
public ActionResult <Guid> AddLevel(Guid topicId, [FromBody] EmptyLevelDTO level) { var(_, isFailure, id, error) = applicationApi .AddEmptyLevel( topicId, level.Description, level.PreviousLevels, level.NextLevels); if (isFailure) { return(NotFound(error.Message)); } return(Ok(id)); }
public ActionResult <Guid> AddEmptyLevel(Guid topicId, [FromBody] EmptyLevelDTO level) => Ok(service.AddEmptyLevel(topicId, level));