Esempio n. 1
0
        public async Task <Dbo.City> Create(Dto.City city)
        {
            Validated.NotNull(city, nameof(city));

            Dbo.City addedCity = this.unitOfWork.Cities.Add(mapper.Map(city));

            await this.unitOfWork.SaveChanges();

            return(addedCity);
        }
Esempio n. 2
0
        public Dbo.City Map(Dto.City city)
        {
            if (city == null)
            {
                return(null);
            }

            return(new Dbo.City
            {
                CityId = city.Id,
                Name = city.Name
            });
        }
Esempio n. 3
0
        public Dto.City Map(Dbo.City city)
        {
            if (city == null)
            {
                return(null);
            }

            var result = new Dto.City
            {
                Id   = city.CityId,
                Name = city.Name
            };

            return(result);
        }