public async Task <ActionResult <Promocode> > Post([FromBody] Promocode promocode) { promocode.Id = await _repo.GetNextId(); promocode.Code = CodeGenerator.Get(promocode.Id); await _repo.Create(promocode); return(new OkObjectResult(promocode)); }
public async Task <ActionResult <Promocode> > Post([FromBody] Promocode promocode) { promocode.Id = await _repo.GetNextId(); promocode.Code = CodeGenerator.Get(promocode.Id); await _repo.Create(promocode); return(new OkObjectResult(promocode)); }