价值类型 [英] Value Types
问题描述
Hola,
Hola,
给定一个可搜索的类(带有sting值和字符串SearchableValue)和一个Person类,其中FirstName和LastName各自为Searchable类型。 ..
given a Searchable class (with a sting Value and a string SearchableValue) and a Person class, with a FirstName and LastName each of type Searchable...
模型无法正确生成。
我该如何适当地宣布这些事情?
How would I go and declare things appropriatly ?
我期待一个Person类:FirstName_Value,FirstName_SearchableValue,LastName_Value,LastName_SearchableValue。
I am expecting a Person class with : FirstName_Value, FirstName_SearchableValue, LastName_Value, LastName_SearchableValue.
感谢您的帮忙!
推荐答案
Tuath,
Tuath,
您需要使用ModelBuilder.ComplexType API告诉Code First Searchable是一个复杂类型。
You need to tell Code First that Searchable is a Complex Type using the ModelBuilder.ComplexType API.
干杯,
安德鲁。
这篇关于价值类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!