保留对自动生成的 WCF RIA 服务域类的更改

发布于 2024-09-26 16:02:48 字数 248 浏览 0 评论 0原文

在创建基于实体框架的自动生成的 WCF 域服务类期间,还会创建一个包含 EF 类的元数据的文件。在此文件中,我必须将 [Include()] 属性添加到许多类,以便我可以在 WCF 调用期间包含这些属性。我的问题是,有时我必须更改数据模型。这要求我删除整个元数据文件以及域服务文件,并重新生成整个文件,然后返回并将 [Include()] 属性添加回正确的属性。有更好的方法吗?有没有办法将 [Ininclude()] 属性保存在单独的文件中,这样我就不必不断返回并将它们添加进去?

During the creation of an auto-generated WCF domain service class based off entity framework, a file that contains the metadata for the EF classes is also created. In this file, I've had to add the [Include()] attribute to a number of classes so that I can include these properties during WCF calls. My problem is, I sometimes have to changed the data model. This requires that I remove the entire metadata file along with the domain services file, and regenerate the entire thing and then go back and add the [Include()] attributes back to the correct properties. Is there a better way to do this? Is there a way to keep the [Include()] attributes in a separate file so that I don't have to continuously go back and add them in?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文