示例#1
0
        public static BeerViewModelDetails ToBeerViewModelDetails(this BeerDto source)
        {
            var result = new BeerViewModelDetails
            {
                Id         = source.Code,
                Name       = source.Description,
                Graduation = source.Graduation,
                BeerTypeId = source.BeerTypeId,
                CountryId  = source.CountryId,
                CityId     = source.CityId
            };

            return(result);
        }
示例#2
0
        public static BeerDto ModelDetailsToBeerDto(this BeerViewModelDetails source)
        {
            var result = new BeerDto
            {
                Code        = source.Id,
                Description = source.Name,
                Graduation  = source.Graduation,
                BeerTypeId  = source.BeerTypeDto.Code,
                CountryId   = source.CountryDto.Code,
                CityId      = source.CityDto.Code
            };

            return(result);
        }