private async Task <Guid> CreateClassFlowAsync()
        {
            Console.WriteLine("What is the name of the class?");
            string className          = Console.ReadLine();
            var    createClassRequest = new CreateClassRequest()
            {
                Name = className
            };
            CreateClassResult createClassResponse = await _classController.CreateClassAsync(createClassRequest);

            Guid classId = createClassResponse.ClassId;

            if (createClassResponse.ValidationMessages.Any())
            {
                SharedConsoleFlows.PrintValidationMessages(createClassResponse.ValidationMessages);
                classId = await CreateClassFlowAsync();
            }
            return(classId);
        }
Example #2
0
        public async Task <IActionResult> Create([FromBody] ClassManageModel classEntityManageModel)
        {
            var response = await _classService.CreateClassAsync(classEntityManageModel);

            return(new CustomActionResult(response));
        }