c# - Create table using Entity Framework -


i have task. task allow user create table in database. user inputs columns names , types, not know how many columns in our table. problem is: must use entity framework. can using entity framework? or not possible?

probably isn't best approach, can send database query containing create table definition.

for example:

public class context : dbcontext {  }  class program {     static void main(string[] args)     {         var mytabledefinition = "create table test(columnteste integer primary key)";         using (var context = new context())         {             context.database.createifnotexists();             context.database.executesqlcommand(mytabledefinition);         }     } } 

final result:

enter image description here


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -