0

I am using a mapping file that contains the Entity and the Column Names to perform the insert on so can this be done with entity framework ?

The alternative version is just to use inline SQL and write code like

sql = INSERT INTO " + someTable + etc....

punkouter
  • 5,170
  • 15
  • 71
  • 116

1 Answers1

1

I don't think using Entity Framework (EF) will be a good fit for this project you're working on. One of the main benefits of using EF is the object graph; it takes care of recognizing new records, updated records and so on.

If you are working with dynamic objects and tables where you truly only know where your underlying data store is at runtime, then I would opt for using a generic database class with parameterized stored procedures.

Obviously the Entity Framework has gotten incredibly popular, but, there's nothing wrong with executing SQL the ol' fashioned way. EF doesn't have to be the only way you interact with your database.

Justin Helgerson
  • 24,900
  • 17
  • 97
  • 124
  • It looks like Ill have to use plain SQL as demoed at this site. The problem iits a conversion tool and some of the conversions are so generic that it makes sense to use a XML mapping file to describe it rather than a separate function – punkouter May 31 '13 at 20:04