简体   繁体   中英

web service and entity framework

Ive been playing around with the entity framework with an idea for creating a web service to be consumed by an application in sharepoint that a 3rd party developer is creating. Basically i need to return a list of jobs eg list based on some search criteria. I wanted to use the EF so i have something scalable however it seems returning POCO's from a web service is harder than i imagined it to be. Are web services and EF / POCO's meant to work together. Does anyone have any good examples or can point me to some.

Are web services and EF / POCO's meant to work together.

Yes. The only thing you must to ensure is to make your entities serializable - POCO entities can contain circular references which are not serializable by default.

What about consuming the web service? I read somewhere that the consumer has to reference the entity namespace to use the returned objects.

This is not true with POCOs. This is only true with Self tracking entities .

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