简体   繁体   中英

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. 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. 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. 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. 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. 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. 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. But I cant have it all I quess...

Data Abstract can be a ready to use option

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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