Code first: does fluent api influence UI?

前端 未结 3 2033
温柔的废话
温柔的废话 2021-02-04 15:12

I\'m reading a book written by Julie Lerman on Code First. According to the book, annotations and fluent api give the same result. Everything depends on the style of the develop

3条回答
  •  無奈伤痛
    2021-02-04 15:57

    According to Julie Lerman's book on DbContext, you do NOT need any additional annotations to your Fluent API configuration. The Name property will get validated by Validation API as if it had been configured with Data Annotations.

    According to the same book, MaxLength and Required are the only validation attributes with fluent API conterparts.

提交回复
热议问题