0

I have an application where I create database's dynamically in a SQL Server using Server Management Objects through my application.

I want to use the Entity Framework to access this database when it has been created, is this possible? As I can not generate Entity classes from a database in VS. I do have the structure of the database of course.

So is it possible to create the Entity classes manually and is that a do-able task?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415

2 Answers2

4

Yes, it's completely possible. You can even manipulate the generated code if you want.

What you might want to take a look is the EDMX XML specification.

In that file you specify the underlying database, views, functions, procedures and the like, as well as the desired objects. Take a look at MSDN in order to have more information.

Paulo Santos
  • 11,285
  • 4
  • 39
  • 65
1

Paulo is right for EF 1 (+1). For EF 4, I'd suggest using code-only modeling instead.

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273