public static async Task <Guid> Create(string name, bool enabled)
        {
            CreateConfigurationCommand command = new CreateConfigurationCommand {
                Name = name, Enabled = enabled
            };
            Guid Id = await Mediator.Send(command);

            return(Id);
        }
Beispiel #2
0
        public async Task <IActionResult> Post([FromBody] ConfigurationViewModel model)
        {
            var command = new CreateConfigurationCommand(UserId, model.LunchTime, model.ToleranceTime, model.WorkingTime);
            await _mediator.Send(command);

            if (HasNotifications())
            {
                return(BadRequest(LoadErrorMessages()));
            }

            return(Ok());
        }
        public async Task <ActionResult <Guid> > Post(CreateConfigurationCommand command)
        {
            Guid configurationId = await _mediator.Send(command);

            return(configurationId);
        }