Beispiel #1
0
        public ActionResult <CompanyDto> AddCompany(CreateCompanyDto company)
        {
            var companyModel = _mapper.Map <Company>(company);

            _leadsRepo.AddCompany(companyModel);
            _leadsRepo.Save();

            var companyToReturn = _mapper.Map <CompanyDto>(companyModel);

            return(CreatedAtRoute("GetCompanyById",
                                  new { Id = companyModel.Id }, companyToReturn));
        }