views:

22

answers:

1

How do I specify Xml or just in-memory storge for Entity Framework models? The connection string requires a provider (usually a SQL provider string). But it won't let me omit the provider.

I realize I could completely throw away the designer generated objects and go pure POCO, but then I'd have to implement my own serialization layer (could do that, but it's overkill for the tiny project I'm working on).

Is there built-in support in EF 4.0 for this that I'm missing or do I just need to go the pure POCO route and discard the designer experience entirely :(

A: 

If you want to store data in Xml or memory you should probably not use EF. EF is designed to work with relational databases.

See also: http://stackoverflow.com/questions/608477/entity-framework-with-xml-files

For storing data in memory use System.Runtime.Caching

For storing data in xml files see: http://msdotnetsupport.blogspot.com/2007/04/reading-and-writing-xml-files-using-c.html

Shiraz Bhaiji
In my case the conceptual model is always relational, but the backend storage may or may not be relational. Depending on the specific implementation or connection, it may be SQL, it may be Xml, it may be a custom flat file, or it may be just a temporary collection of objects in memory.
Simon Gillbee
Thanks for the links... I'll look over them.
Simon Gillbee