Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个具有两个常量的实体。我希望声明在实体声明中而不是在架构中,但我需要在架构中使用常量。
要回答您的问题:
但正如查尔斯在他的回答中所说,如果它们实际上是您有时想要更改的“常量”,您可能需要考虑使用泛型而不是常量。
你知道泛型吗?看起来他们可能是你想要的。