Exemplo n.º 1
0
        public async Task <BusinessModel> CreateBusiness(BusinessModel businessModel)
        {
            var businessEntity = _mapper.Map <BusinessEntity>(businessModel);

            _libraryRepository.CreateBusiness(businessEntity);
            var result = await _libraryRepository.SaveChangesAsync();

            if (result)
            {
                return(_mapper.Map <BusinessModel>(businessEntity));
            }

            throw new Exception("Database Error");
        }