Ejemplo n.º 1
0
        public async Task <IActionResult> Create([FromBody] CreateLeagueCommand cmd)
        {
            var isValid = ModelState.IsValid;
            var dto     = await _leagueService.CreateLeague(cmd);

            return(dto == null ? (IActionResult)BadRequest() : Created(new Uri("a"), dto));
        }
        public IActionResult CreateLeague([FromBody] LeagueModel teamModel)
        {
            var command = new CreateLeagueCommand(teamModel);

            CommandDispatcher.Handle(command);
            return(Ok());
        }
Ejemplo n.º 3
0
        public ActionResult Create(CreateLeagueCommand command)
        {
            HandleCommand(command, Json("League created"));

            return(RedirectToAction("Index"));
        }
 public async Task <IActionResult> Post(CreateLeagueCommand command)
 {
     return(Ok(await Mediator.Send(command)));
 }