コード例 #1
0
        protected virtual CategoryViewModel CreateCategoryViewModel(CreateCategoryViewModelParam param)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }
            if (param.Category == null)
            {
                throw new ArgumentException(ArgumentNullMessageFormatter.FormatErrorMessage("Category"), "param");
            }
            if (param.CultureInfo == null)
            {
                throw new ArgumentException(ArgumentNullMessageFormatter.FormatErrorMessage("CultureInfo"), "param");
            }

            return(_viewModelMapper.MapTo <CategoryViewModel>(param.Category, param.CultureInfo));
        }
コード例 #2
0
        protected virtual CategoryViewModel CreateCategoryViewModel(CreateCategoryViewModelParam param)
        {
            if (param == null)
            {
                throw new ArgumentNullException(nameof(param));
            }
            if (param.Category == null)
            {
                throw new ArgumentException(GetMessageOfNull(nameof(param.Category)), nameof(param));
            }
            if (param.CultureInfo == null)
            {
                throw new ArgumentException(GetMessageOfNull(nameof(param.CultureInfo)), nameof(param));
            }

            return(_viewModelMapper.MapTo <CategoryViewModel>(param.Category, param.CultureInfo));
        }