Code First Custom Convention for schema Naming

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
francischie
Posts: 5
Joined: Fri 04 Feb 2011 22:32
Location: United States

Post by francischie » Fri 25 Mar 2011 22:55

Thanks Andrey for the notes.

For the note 1, I didn't realized when I post the code that I'm using the ODP.Net beta provider (my dotConnect trial expired) which does not require to remove the System.Data.Entity.Infrastructure.IncludeMetadataConvention.

Is there are plan also for the dotConnect provider to omit declaring the removal of MetadataConvetion like the ODP.Net?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 28 Mar 2011 12:00

@francischie
Seems like you are a bit misled:
1. It is necessary to remove ColumnTypeCasingConvention when working with dotConnect for Oracle.
2. But it is your own choice whether to use IncludeMetadataConvention or not. If IncludeMetadataConvention is used, the "dbo"."EdmMetadata" table will be created in the database. This table allows to Entity Framework to determine whether the schema in the database is different from the one in the EF model or not.

Remco Blok
Posts: 25
Joined: Tue 14 Dec 2010 12:34

Post by Remco Blok » Tue 29 Mar 2011 07:29

You can continue to use the EdmMetadata table in any schema you like by first removing the convention that maps it to the dbo schema and then remapping it to your own schema:

modelBuilder.Conventions.Remove();

modelBuilder.Entity().ToTable("EdmMetadata", "MYSCHEMA);

Remco Blok
Posts: 25
Joined: Tue 14 Dec 2010 12:34

Post by Remco Blok » Thu 31 Mar 2011 10:50

AndreyR wrote:We plan to add a workaround that will remove Schema name from all queries and commands. This workaround should solve the problem.
If you have any other suggestions, please visit our Entity Framework Support UserVoice. Please vote for the existing suggestions as well.
If it is possible to remove the schema name from all queries and commands, is it also possible to get the schema name from web.config or app.config and use that one instead of removing it? Removing the schema name completely will also remove the ability to connect as one user but have all queries and commands executed against the schema of another user (provided permissions are correctly set up). Without saying whether this is something you do or do not want to do, removing the schema name will also remove the ability to do so. Just a thought.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 31 Mar 2011 15:34

Well, it is possible to execute the "ALTER SESSION SET CURRENT_SCHEMA = MYSCHEMA" statement or to create (public) synonyms for the necessary objects.

Remco Blok
Posts: 25
Joined: Tue 14 Dec 2010 12:34

Entity Framework 4.1 RTW supported in 6.10.141 19-Apr-11

Post by Remco Blok » Tue 19 Apr 2011 11:11

Just saw 6.10.141 is released with EF 4.1 RTW support. How did DevArt end up resolving the schema issue? Is the schema name completely removed from all statements or is it configurable?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 20 Apr 2011 09:04

We have added the EntityProviderConfig.Workarounds class. It contains the IgnoreSchemaName property. When set to true, it removes the schema name from all commands and queries.
Please note that this functionality will be available only in the upcoming Beta build to be released later this month.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 03 May 2011 13:53

dotConnect for Oracle 6.30 Beta is available.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20828 .

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 06 May 2011 06:56

We have updated the Entity Framework Code-First support article (and samples) to reflect changes between EF CTP5 and EF 4.1 RC. This article includes now usage of the IgnoreSchemaName workaround, the DefaultConnectionFactory and Creating Entity Framework Model with Fluent Mapping in Designer sections.
http://www.devart.com/blogs/dotconnect/ ... qlite.html

Post Reply