分享至
我平常在使用MVC專案的時候,會直接採用MetaDataType的方法,但webApi在這方面不能用,FluentApi可以使用在驗證,但對於欄位中對Json的序列化行為[JsonIgnore]等不能使用。
想請問還有什麼方法是在webapi能使用的嗎?
已邀請的邦友 {{ invite_list.length }}/5
你有試過 https://learn.microsoft.com/en-us/ef/core/cli/powershell#scaffold-dbcontext 這上面的-DataAnnotations 指令嗎? 也許是你需要的
IT邦幫忙