Results 1 to 3 of 3

Thread: Create entity model in C# from database, but changing object names

  1. #1

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    Create entity model in C# from database, but changing object names

    I was considering creating a basic object model in my new C# MVC project by importing all of the database tables using the entity framework. However, our database standards mean that all tables are prefixed with tbl; e.g. the table for client details is called tblClient.

    Is there a way to import all of the tables into the C# application while applying a conversion filter to remove that tbl from the front of every object, so that my client object is created with the name Client rather than tblClient?

    Thanks...
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Create entity model in C# from database, but changing object names

    I think that the content of the generated model (.edmx file) is XML so you can edit it after you have imported the model from the database as such and then generate your classes from that?

  3. #3

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    Re: Create entity model in C# from database, but changing object names

    That's a good idea - I'll give it a whirl.
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width