문제

I am using entity framework db first. how do I add data annotations to the model without putting it into the auto generated model?

I want to avoid losing the work I have done, in case I need to add a new column to the table.

Any small explanation or link would be helpful for me to understand.

thanks,

Andy

도움이 되었습니까?

해결책

You can use a second partial class that is created by you which includes the data annotations you like.

Look here for an answer covering this issue.

다른 팁

I think Code first migrations is what you are looking for.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top