Beispiel #1
0
        public async Task <IActionResult> Put(int id, [FromBody] CorrentistaVM correntista)
        {
            Correntista request = mapper.Map <CorrentistaVM, Correntista>(correntista);

            request.Id = id;
            correntistaService.Update(request);
            await unitOfWork.SaveChangesAsync();

            return(Response(mapper.Map <Correntista, CorrentistaVM>(request)));
        }
Beispiel #2
0
        public async Task <IActionResult> Post([FromBody] CorrentistaVM correntista)
        {
            Correntista request = mapper.Map <CorrentistaVM, Correntista>(correntista);

            request.ContaCorrentes = new List <ContaCorrente>();
            correntistaService.Add(request);
            await unitOfWork.SaveChangesAsync();

            return(Response(correntista, $"api/correntista/{request.Id}"));
        }