Ejemplo n.º 1
0
        public MaloCultureViewModel CreateMaloCultureViewModel(MaloCultureDto maloCultureDto)
        {
            if (maloCultureDto == null)
            {
                throw new ArgumentNullException(nameof(maloCultureDto));
            }

            var model = new MaloCultureViewModel
            {
                Id        = maloCultureDto.Id,
                Brand     = CreateMaloBrandViewModel(maloCultureDto.Brand),
                Style     = CreateMaloStyleViewModel(maloCultureDto.Style),
                Trademark = maloCultureDto.Trademark,
                TempMax   = maloCultureDto.TempMax,
                TempMin   = maloCultureDto.TempMin,
                Alcohol   = maloCultureDto.Alcohol,
                pH        = maloCultureDto.pH,
                SO2       = maloCultureDto.So2,
                Note      = maloCultureDto.Note
            };

            model.Brands.AddRange(CreateSelectList("Brand", _maloBrandsDtoList));
            model.Styles.AddRange(CreateSelectList("Style", _maloStylesDtoList));

            return(model);
        }
Ejemplo n.º 2
0
        public MaloCultureViewModel CreateMaloCultureViewModel()
        {
            var model = new MaloCultureViewModel();

            model.Brands.AddRange(CreateSelectList("Brand", _maloBrandsDtoList));
            model.Styles.AddRange(CreateSelectList("Style", _maloStylesDtoList));
            return(model);
        }