示例#1
0
        public ICommandResult Handle(CreateLeilaoCommand command)
        {
            // Fail Fast Validation(o comando chegou falho ele já barra e avisa)
            command.Validate();
            if (command.Invalid)
            {
                return(new GenericCommandResult(false, "Algo deu errado ao incluir!", command.Notifications));
            }

            var leilao = new ItemLeilao
                         (
                command.nome_leilao,
                command.valor_inicial,
                command.item_usado,
                command.data_inicio,
                command.data_fim,
                command.nome_usuario,
                command.User
                         );

            _repository.Create(leilao);

            return(new GenericCommandResult(true, "Leilão salvo!", leilao));
        }
 public void Create(ItemLeilao leilao)
 {
 }
 public void Update(ItemLeilao leilao)
 {
 }
 public void Delete(ItemLeilao leilao)
 {
 }
示例#5
0
 public void Update(ItemLeilao leilao)
 {
     _context.Entry(leilao).State = EntityState.Modified;
     _context.SaveChanges();
 }
示例#6
0
 public void Delete(ItemLeilao leilao)
 {
     _context.Leiloes.Remove(leilao);
     _context.SaveChanges();
 }
示例#7
0
 public void Create(ItemLeilao leilao)
 {
     _context.Leiloes.Add(leilao);
     _context.SaveChanges();
 }