Composite C1 and the Entity Framework

Topics: General
May 31, 2011 at 8:49 PM

We have an external database that we're integrating with Composite C1 and we've figured out how to implement the NorthWind Database here: http://docs.composite.net/C1/Data/CustomDataProviders/ReadingSqlServerData.aspx

However, that sample uses Linq2SQL. Our external database already has an Entity Framework layer to access and we're wondering if there's any guidance on what we'd need to do to use Entity Framework instead of Linq2SQL.

Coordinator
Jun 1, 2011 at 10:40 AM

We haven't tried building a EF / C1 Data Provider combo yet, but it makes a lot of sense - we will get back to you on this one, give us a few days.

Jun 1, 2011 at 11:12 AM

I have been looking into it, it could open up for using a wide range of more databases since db-support in EF is itself provider based :) There are some strong bindings for SQL Management Objects in the current sqlprovider implementation for C1 though, so its not only a question of exposing IQueryable, but the provider should also be able to create, delete and update tables.

See also http://compositec1.codeplex.com/discussions/238810 for an earlier discussion on the topic.

Coordinator
Jun 1, 2011 at 12:38 PM

@burningice Did you get a "read only" provider - just simple reads, without any tynamic typing and no data updates - up and running?

Jun 2, 2011 at 9:36 AM
Edited Jun 2, 2011 at 9:37 AM

It was working... sorta... in a tightly controlled environment :) i was manually creating the store and the model and just returning hardcoded values every time C1 was requesting for configuration information.

Hard big trouble getting dynamic types to work so it was only with static types as well.

Coordinator
Jun 7, 2011 at 9:33 AM

@atomiton please check http://docs.composite.net/ReadingDataViaEntityFramework - just published. Feedback much appreciated :)

Jun 7, 2011 at 10:02 AM

*thumbs up* for a good walk through

a minor thing with the wording to sort out any misunderstandings... classes are inherited from, while interfaces are implemented. http://programmers.stackexchange.com/questions/11920/do-we-inherit-an-interface-or-implement-an-interface

:)