Exemplo n.º 1
0
        public ActionResult <BandDto> CreateBand(CreateBandDto bandDto)
        {
            var band = _mapper.Map <Band>(bandDto);

            _repository.AddBand(band);
            _repository.Save();
            var bandToReturn = _mapper.Map <BandDto>(band);

            return(CreatedAtRoute("GetBand", new { bandId = band.Id }, bandToReturn));
        }
Exemplo n.º 2
0
 public IActionResult Post([FromBody] CreateBandDto band)
 {
     //Call a method to add a new record to the entity
     return(Ok());
 }