@@ -17,7 +17,7 @@ private ElementGenerator(ITagGenerator tags)
1717
1818 public static ElementGenerator < T > For ( HtmlConventionLibrary library , Func < Type , object > serviceLocator = null , T model = null )
1919 {
20- serviceLocator = serviceLocator ?? ( Activator . CreateInstance ) ;
20+ serviceLocator = serviceLocator ?? Activator . CreateInstance ;
2121
2222 var tags = new TagGenerator ( library . TagLibrary , new ActiveProfile ( ) , serviceLocator ) ;
2323
@@ -33,6 +33,9 @@ public HtmlTag LabelFor<TResult>(Expression<Func<T, TResult>> expression, string
3333 public HtmlTag InputFor < TResult > ( Expression < Func < T , TResult > > expression , string profile = null , T model = null )
3434 => Build ( expression , ElementConstants . Editor , profile , model ) ;
3535
36+ public HtmlTag ValidationMessageFor < TResult > ( Expression < Func < T , TResult > > expression , string profile = null , T model = null )
37+ => Build ( expression , ElementConstants . ValidationMessage , profile , model ) ;
38+
3639 public HtmlTag DisplayFor < TResult > ( Expression < Func < T , TResult > > expression , string profile = null , T model = null )
3740 => Build ( expression , ElementConstants . Display , profile , model ) ;
3841
@@ -41,8 +44,8 @@ public HtmlTag TagFor<TResult>(Expression<Func<T, TResult>> expression, string c
4144
4245 public T Model
4346 {
44- get { return _model . Value ; }
45- set { _model = new Lazy < T > ( ( ) => value ) ; }
47+ get => _model . Value ;
48+ set => _model = new Lazy < T > ( ( ) => value ) ;
4649 }
4750
4851 public ElementRequest GetRequest < TResult > ( Expression < Func < T , TResult > > expression , T model = null )
@@ -70,6 +73,8 @@ private HtmlTag Build(ElementRequest request, string category, string profile =
7073
7174 public HtmlTag InputFor ( ElementRequest request , string profile = null , T model = null ) => Build ( request , ElementConstants . Editor , profile , model ) ;
7275
76+ public HtmlTag ValidationMessageFor ( ElementRequest request , string profile = null , T model = null ) => Build ( request , ElementConstants . ValidationMessage , profile , model ) ;
77+
7378 public HtmlTag DisplayFor ( ElementRequest request , string profile = null , T model = null ) => Build ( request , ElementConstants . Display , profile , model ) ;
7479
7580 public HtmlTag TagFor ( ElementRequest request , string category , string profile = null , T model = null ) => Build ( request , category , profile , model ) ;
0 commit comments