public async Task <string> CreateOrUpdate([FromBody] EmployeeCreateOrUpdateCommand model)
        {
            await _handler.Handle(model);

            return(JsonConvert.SerializeObject(new
            {
                sucess = !model.Failures.Any(),
                erros = model.Failures
            }));
        }
Esempio n. 2
0
        public void EmployeeCreateIsValid()
        {
            var command = new EmployeeCreateOrUpdateCommand
            {
                Birth     = DateTime.Now,
                Email     = null,
                Genre     = true,
                Id        = null,
                Name      = "Testando mais",
                Role      = 1,
                Dependent = null
            };


            Assert.AreEqual(true, command.IsValid());
        }