Exemplo n.º 1
0
        public async Task <Dbo.Country> Create(Dto.Country country)
        {
            Validated.NotNull(country, nameof(country));

            Dbo.Country addedCountry = this.unitOfWork.Countries.Add(mapper.Map(country));

            await this.unitOfWork.SaveChanges();

            return(addedCountry);
        }
Exemplo n.º 2
0
        public Dbo.Country Map(Dto.Country country)
        {
            if (country == null)
            {
                return(null);
            }

            return(new Dbo.Country
            {
                CountryId = country.Id,
                Name = country.Name
            });
        }