문제

I'm planning on using EF in a WCF Service. The database that will be used already exists.

I was wondering if I need to map the retreived entities to a datacontract, or can I use them directly?

And on a more general base: are there any pitfalls I should beware of?

도움이 되었습니까?

해결책

다른 팁

If EF generates POCO classes for your existing DB, then WCF should be able to serialize the classes by just using their public properties, even without them being marked as a [DataContract]. However if they are non-POCO tracking objects, then you will probably have to translate them to a different type for WCF to serialize it.

But there are so many versions and configurations and ways to use WCF and EF, that it is hard to answer this with any certainty.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top