3

How to set comment with Entity Framework, odp.net.

COMMENT ON COLUMN Users.UserId IS 'User identifier'
COMMENT ON COLUMN Users.UserName IS 'User Name'

I would like to realize this query using Entity Framework Code First.

public class User
{
    public int UserId { get; set; }
    public string UserName { get; set; }
}

Please tell me what to do.

mine6
  • 31
  • 1
  • 3

1 Answers1

0

There is no built-in functionality to do this in Entity Framework. You can use the information in this answer, which discusses adding descriptions to SQL Server tables, as a basis to create your own solution.

The solution involves looking for attributes containing the comments, then using this information to generate SQL to update the description. As the linked solution is SQL Server-specific, you'll need to update any of the SQL to the oracle equivalents.

Community
  • 1
  • 1
Richard
  • 29,854
  • 11
  • 77
  • 120