Jignesh Gadhia
Jignesh Gadhia

Reputation: 135

Whenever I update edmx file it changes model1.context.cs's class name

Whenever I update edmx file, it automatically changes the class name and constructor name. How can I prevent it?

Model1.context.cs

My code before update of edmx

 public partial class RKDYMEntities : DbContext
{
    public RKDYMEntities()
        : base("name=RKDYMEntities")
    {
    }

Code After Updates

public partial class Entities : DbContext
{
    public Entities()
        : base("name=Entities")
    {
    }

Upvotes: 4

Views: 2066

Answers (1)

Jenish Rabadiya
Jenish Rabadiya

Reputation: 6766

If you want to rename your Container class name then do follow below steps:

  1. Open edmx file and click on Design surface
  2. Press F4 or right click and select properties.
  3. Change property Entity Container Name to RKDYMEntities

Upvotes: 3

Related Questions