Beispiel #1
0
        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);
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
 public ActionResult <Guid> AddEmptyLevel(Guid topicId, [FromBody] EmptyLevelDTO level) => Ok(service.AddEmptyLevel(topicId, level));