-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataLoader for CodeFirst Context loading #99
Comments
Hello @Libeny , Do you think you could provide us a test project with this issue? It will make easier/faster for my developer to getting started for investigating it. We now always ask for a project since we found out that most issues are missing some essential information or are resolved by the requestor when creating it Best Regards, Jonathan |
Hi Jonathan, Thanks for looking into it. I've attached the test project. Hopefully my intent is clear, let me know if you have any questions. Regards Liben |
Thank a lot, It will be assigned to one of my developers this week. Best Regards, Jonathan |
Hello @Libeny , The DataLoader support for code first has been added in v1.3.3 You will need however to specify a context factory (that's used under the hood to make this feature work). For example EntityFrmeworkEffortManager.ContextFactory = (currentContext) => new EntitiesContext() Best Regards, Jonathan |
Hi Jonathan, I've just tested and its working, thanks a lot. For anyone else trying to load using Code First the below snippet should help:
Regards Liben |
Where do you pass the connection string? |
This might already be possible but I couldn't find a way to getting it to work.
Configuration for database connection:
<add name="SqlClientConnection" connectionString="Data Source=.\sqlexpress;Initial Catalog=MyDatabase;Integrated Security=True;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient" />
When loading this is throwing errors.
"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid."
If the connection string is based on the System.Data.SqlClient provider this will not work as it is expecting EntityClient provider connection, but the EntityClient provider connection is used more for the database first connections and is not applicable for Code First. When trying to create a connection using the EntityClient provider but without the model files, again there are errors on loading as it expects the metadata property to have a value.
So this is a first question is it possible to get the loader working for CodeFirst? And if so how?
If not then I guess this should be documented its not possible and maybe a new feature request.
The text was updated successfully, but these errors were encountered: