Exemplo n.º 1
0
        public IActionResult Create([FromBody] Address model)
        {
            if (model == null || !ModelState.IsValid)
            {
                return(BadRequest());
            }

            _repo.Add(model);
            return(CreatedAtAction("Create", model));
        }
Exemplo n.º 2
0
 public virtual Address Add(Address address)
 {
     _logger.LogInformation($"Add Address");
     return(address.Validate(true) ? _mapper.Map <Address>(_addressRepo.Add(_mapper.Map <Entity.Address>(address))) : null);
 }