{

                model.Field(p => p.CategoryId).DefaultValue(
                    (ViewData["defaultCategory"] as ProductCategory) != null ? (ViewData["defaultCategory"] as ProductCategory).CategoryId : default(int?));
            })