Skip to content

Doesn't support multiple connectionStrings in app.config #56

@jlrouzies-mantu

Description

@jlrouzies-mantu

Hello,

When having multiple connection strings, despite taking the good one at the DbContext initialization, and have the GET actions to work well, some how this Repository system was not taking the good connection string when doing a Save:

  public void Save(Entity entity)
  {
      entity.ObjectState = ObjectState.Modified;
      _context.SyncObjectState(entity);
      _context.SaveChanges();
  }

Even if the _context object points to the proper one.

After testing, I realized it takes the first connectionString in the list, regardless of any DbContext configuration.

This is pretty bad to be honest. Can it be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions