public async Task <ActionResult> UpdateCommandeById(int id, [FromBody] CommandeForUpdateDto commandeDto)
        {
            CdeCli commande = await _commandeRepository.GetCommandeById(id);

            _mapper.Map(commandeDto, commande);

            await _commandeRepository.UpdateCommande();

            return(NoContent());
        }
        public async Task <ActionResult> CreateCommande(CommandeForCreateDto commandeDto)
        {
            CdeCli commandeToCreate = _mapper.Map <CdeCli>(commandeDto);

            await _commandeRepository.CreateCommande(commandeToCreate);

            return(CreatedAtRoute("GetCommande", new
            {
                id = commandeToCreate.Num_Cde_Cli
            }, commandeToCreate));
        }
        public async Task <int> CreateCommande(CdeCli commande)
        {
            await _pizzaDbContext.AddAsync(commande);

            return(await _pizzaDbContext.SaveChangesAsync());
        }
Example #4
0
 public async Task CreateCommand(CdeCli command)
 {
     await _unitOfWork.Commands.CreateCommand(command);
 }