Entity Framework Power Tools Beta 3

An extension that allows you to reverse engineer “Code First”. Generates POCO classes, derived DbContext and Code First mapping for an existing database.

You can download here: Entity Framework Power Tools Beta 3

When right-clicking on a C# project, the following context menu appears:

efpowertoolsbeta3

For Columns (fields) to accept null you have 2 options:

Nullable<datatype> -> Example Nullable<int>

or

datatype? -> Example int?

The following tables show the conversions performed by the Entity Framework Power Tools Beta 3 (EF Tools).

Integers

C# SQL Server Nullable
byte tinyint not null
Nullable<byte> tinyint null
short smallint not null
Nullable<short> smallint null
int int not null
Nullable<int> int null
long bigint not null
Nullable<long> bigint null

Decimals

C# SQL Server Nullable
decimal decimal, numeric, money smallmoney not null
Nullable<decimal> decimal, numeric, money smallmoney null
double float not null
Nullable<double> float null
float real not null
Nullable<float> real null

Includes decimal(18,0), numeric(18,0)

Binary

C# SQL Server Nullable
bool bit not null
Nullable<bool> bit null
byte[] binary, image, timestamp, varbinary null, not null

Includes varbinary(50), varbinary(max)

Strings

C# SQL Server Nullable
string char, nchar, varchar, nvarchar, xml, text, ntext null, not null

Includes varchar(50), varchar(max)

Date and Time

C# SQL Server Nullable
System.DateTime date, datetime, datetime2(7), smalldatetime not null
Nullable<System.DateTime> date, datetime, datetime2(7), smalldatetime null
System.DateTimeOffset datetimeoffset(7) not null
Nullable<System.DateTimeOffset> datetimeoffset(7) null
System.TimeSpan time(7) not null
Nullable<System.TimeSpan> time(7) null

Special Data Types

C# SQL Server Nullable
System.Data.Entity.Spatial.DbGeography geography null, not null
System.Data.Entity.Spatial.DbGeometry geometry null, not null
System.Guid uniqueidentifier not null
Nullable<System.Guid> uniqueidentifier null

Columns with these datatypes will be ignored

C# SQL Server Nullable
N.A. hierarchyid, sqlvariant null, not null

These datatypes can’t be converted by the Entity Framework Power Tools Beta 3 and they are skipped

Update.

When trying to reverse engineer a SQL Azure database I get the following error ”

System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.InvalidOperationException: This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection. ---> System.Data.SqlClient.SqlException: Login failed for user 'youruser'.

Any ideas?

Advertisements
This entry was posted in EF Tools and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s