コード例 #1
0
        public GenericCommandResult AddApartment(
            [FromBody] AddApartmentCommand command,
            [FromServices] CondominiumHandler handler
            )
        {
            command.User = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;
            var result = (GenericCommandResult)handler.Handle(command);

            return(result);
        }
コード例 #2
0
        public GenericCommandResult Activate(
            Guid id,
            [FromServices] CondominiumHandler handler
            )
        {
            var user    = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;
            var command = new ActivateCondominiumCommand(id, user);

            return((GenericCommandResult)handler.Handle(command));
        }