Change db table name in EF4 (entity framework 4)

后端 未结 6 2117
离开以前
离开以前 2020-12-01 18:53

Does anyone know how to change the mapped db table for an entity in EF4 (entity framework 4)?

Later edit: I think i\'ve found the place where the table names are def

6条回答
  •  难免孤独
    2020-12-01 19:13

    You can execute a stored proc that changes the table name, passing the tablename as a variable. Then import the stored proc into EF4.

    CREATE PROCEDURE ChangeTableName
        @TableName varchar(200)
    AS
    BEGIN
        SET NOCOUNT ON;
        EXEC sp_rename "User", @TableName
    END
    GO
    

提交回复
热议问题