Quantcast
Channel: EntityFramework Reverse POCO Code First Generator
Viewing all articles
Browse latest Browse all 1642

Commented Issue: DataMember isRequired [4]

$
0
0
Referencing version 1.5.0.

The DataMember attribute for 'isRequired' is not working as expected. Columns from the database that are set as nullable are set to 'isRequired=true' and columns that are not-nullable are set to 'false'.

__Changing line 75 of EF.Reverse.POCO.ttinclude__
__from:__
```
<# if(AddWcfDataAttributes) { #> [DataMember(Order = <#=DataMemberOrder++#>, IsRequired = <#=col.IsNullable ? "true" : "false"#>)]
```
__to:__
```
<# if(AddWcfDataAttributes) { #> [DataMember(Order = <#=DataMemberOrder++#>, IsRequired = <#=col.IsNullable ? "false" : "true"#>)]
```

Sets the 'isRequired' attribute to the expected values based on the column specification from the database.
ie: a table column that is nullable is set to isRequired=false
Comments: Thanks for spotting this. I've fixed this bug in v1.5.1.

Viewing all articles
Browse latest Browse all 1642

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>