简体   繁体   English

亚音速映射POCO到不同名称的表

[英]Subsonic map POCO to table of a different name

I started a small project and wanted to use Subsonic's SimpleRepository for my database layer. 我开始了一个小项目,想要在数据库层使用Subsonic的SimpleRepository。 If I have table in my database called Member and I want to create a POCO called TeamMember. 如果我的数据库中有名为Member的表,并且我想创建一个名为TeamMember的POCO。 Can I map class TeamMember to table Member via an attribute or some other method? 我可以通过属性或其他方法将TeamMember类映射到表Member吗? It is possible that what I'm asking is not how the SimpleRepository objects are supposed to be used and if this is the case I would appreciate any suggestions. 我要问的可能不是应该如何使用SimpleRepository对象,如果是这种情况,我将不胜感激任何建议。

Thank you, - eric 谢谢-埃里克

You can - but I might suggest using Inheritance instead. 您可以-但我建议您改用继承。 Remember - SimpleRepo is model-->DB, not the other way round. 记住-SimpleRepo是模型-> DB,而不是相反。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM