Subsonic 3/ASP.net MVC issue trying to override class column properties

那年仲夏 提交于 2019-12-24 20:26:31

问题


I am using Subsonic 3 (T4 template) to generate the models for my mvc app. However the default template does not allow for nullable columns, so when I go to save the record it errors out if a nullable datetime column is blank. (See this post...)

Question: What is the best practice to handle this?
Option 1: Change the template to check if it is a nullable column and decorate the datatype with ? That would take me out of sync with any changes Rob makes to his templates which I might want

Option 2: Is there a way to override the column in a partial class?

Other options?


回答1:


If you grab the latest from the trunk it's been fixed - the templates will set nullable for nullable columns.



来源:https://stackoverflow.com/questions/987325/subsonic-3-asp-net-mvc-issue-trying-to-override-class-column-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!