Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Go Back  Xtreme Visual Basic Talk > > > Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#


Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2016, 12:06 AM
Plavozont Plavozont is offline
Newcomer
 
Join Date: May 2012
Posts: 3
Default Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#


I'm trying to make code first migrations to generate SQL Scripts, which I could use to crate/alter tables, so that my program would be compatible with all Database Engines that Entity Framework is compatible with. I've managed to generate the "CREATE TABLE" script using the migration placed in my "201606090649292_InitialCreate.cs" file and pass the table's name as a parameter, but I can't figure out how to pass the second parameter that represents columns.

Here is the method that I call:

Code:
public partial class InitialCreate : DbMigration
{
    public void create_table(string name)
    {
        CreateTable(
            name,
            c => new
            {
                rb_group_id = c.Int(nullable: false, identity: true),
                rb_group_name = c.String(nullable: false, maxLength: 50),
                rb_group_description = c.String(nullable: false, maxLength: 300),
            })
            .PrimaryKey(t => t.rb_group_id)
            .Index(t => t.rb_group_name, unique: true, name: "unique_key_rb_group_names");
    }
}
That's how I call it:

Code:
var migration_InitialCreate = new InitialCreate();
migration_InitialCreate.create_table("public.my_table_name");
How to pass the second argument of type

Code:
Func<System.Data.Entity.Migrations.Builders.ColumnBuilder, TColumns>
...or maybe just generate sql some other way...
Reply With Quote
Reply

Tags
generate, pass, false, sql, maxlength, public, call, parameter, tables, true, c.stringnullable, compatible, scripts, framework, entity, c.intnullable, rb_group_id, create_tablestring, class, partial, initialcreate, dbmigration, void, createtable, identity


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C# Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
 
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
Generate cross DBMS SQL scripts with entity framework in visual studio 2013 C#
 
-->