简体   繁体   English

WCF:数据库选择、动态实体 Model、服务接口等

[英]WCF: Choice of Database, Dynamic Entity Model, Service Interface etc

Im a bit lost here.我有点迷失在这里。 So many techniques and models to choose from.如此多的技术和模型可供选择。 What I want (I think) is a isolated data storage exposed through a wcf-service.我想要的(我认为)是通过 wcf 服务公开的隔离数据存储。 I want to be able to store any kind of entity in this datastore without having to define the type in the database.我希望能够在此数据存储中存储任何类型的实体,而无需在数据库中定义类型。 I see all entities as a collection of properties/values and relations so there is no need to define a explicit class for each and everyone of them here.我将所有实体视为属性/值和关系的集合,因此无需在此处为每个实体定义明确的 class。 But then I also have other apps and services that utilize this datastore-service.但是我也有其他应用程序和服务使用这个数据存储服务。 In these I will be processing the entities in all kinds of ways, hence they need to be strongly typed here.在这些中,我将以各种方式处理实体,因此它们需要在这里进行强类型化。 Ive looked at Entity Framework, Dynamic Entities, OData etc by none seem to be what Im looking for.我看过实体框架、动态实体、OData 等似乎都不是我想要的。 I want the database to be more like a filesystem, but for entities.我希望数据库更像一个文件系统,但对于实体。 I still like to have some features such as quering with LINQ through WCF.我仍然喜欢一些功能,例如通过 WCF 查询 LINQ。 Also, each app that is using the entities should be able to store its own unique aspects of the entities.此外,每个使用实体的应用程序都应该能够存储自己独特的实体方面。 Is there any ready-to-use option for me out there?那里有适合我的现成选项吗? Or do I have to roll my own?还是我必须自己动手?


Just to follow up on my own question. 只是为了跟进我自己的问题。 Ive done a SQL-db and WCF-interface based on conventions. 我已经完成了基于约定的 SQL-db 和 WCF 接口。 The name of the table defines the namespace/name of the type and the columns its properties. 表的名称定义了类型的命名空间/名称以及列的属性。 Then I generate XML manually based on this information and send it to the clients. 然后我根据此信息手动生成 XML 并将其发送给客户端。 This way I do not need to define any strong types on the database-service and I can easily upgrade it with new "types" through a method on the running service itself. 这样我就不需要在数据库服务上定义任何强类型,我可以通过正在运行的服务本身的方法轻松地用新的“类型”升级它。 It seem to work fine for now but Im still a bit worried it will fail sometime later. 它现在似乎工作正常,但我仍然有点担心它会在以后的某个时候失败。 It will for instance be a lot of work to create a IQueryable/IUpdateable implementation for this which I would have gotten for free with EntityFramework. 例如,为此创建一个 IQueryable/IUpdateable 实现将是很多工作,我可以使用 EntityFramework 免费获得它。 But I cant have it all I quess... 但我不能拥有我所追求的一切......

Data Abstract can be a ready to use option数据摘要可以是一个现成的选项

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

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