예제 #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));
        }
예제 #2
0
 public void Create(ItemLeilao leilao)
 {
 }
예제 #3
0
 public void Update(ItemLeilao leilao)
 {
 }
예제 #4
0
 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();
 }