public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            await _actorService.Create(ActorCreation);

            return(RedirectToPage("/Index"));
        }
Beispiel #2
0
        public IActionResult Create(CreateActorDto createActorDto)
        {
            try
            {
                _service.Create(createActorDto);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Ok());
        }
Beispiel #3
0
        public ActorCreateResponse Create(ActorCreateRequest request)
        {
            ActorCreateResponse response;

            if (ModelState.IsValid)
            {
                response = _actorService.Create(request);
            }
            else
            {
                response = new ActorCreateResponse()
                {
                    ErrorMessage = "Model state not valid"
                };
            }

            return(response);
        }
 public async Task  Create(ActorInputDto inputDto)
 {
     await actorService.Create(inputDto);
 }
Beispiel #5
0
 public IActionResult Create(ActorDTO actorDTO)
 {
     _actorService.Create(actorDTO);
     return(Ok());
 }