# Database wizard UseDatabaseNames etc

**URL:** <https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704>\
**Category:** Radzen Blazor Studio\
**Created:** [September 14, 2026, 4:09pm UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704 "2026-09-14T16:09:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 14, 2026, 4:09pm UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/1 "2026-09-14T16:09:22Z")

</div>

Hello,

If I refresh the model from the database with the database wizard all my classes have other naming conventions:

Old Model:

[Table("Pfuscheraktinhalt", Schema = "dbo")]  
public partial class Pfuscheraktinhalt  
{  
[Key]  
[DatabaseGenerated(DatabaseGeneratedOption.None)]  
[Required]  
public int Akt\_ID { get; set; }

```auto
    public Pfuscherakt Pfuscherakt { get; set; }

    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Dokument_ID { get; set; }

    [Required]
    public int Dokumenttyp_ID { get; set; }

    public Dokumenttyp Dokumenttyp { get; set; }

    [Required]
    public string Dokumentname { get; set; }

    [Required]
    public byte[] Dokumentinhalt { get; set; }

    [DatabaseGenerated(DatabaseGeneratedOption.Computed)]
    public string Dokumentgröße { get; set; }

    public bool Intern { get; set; }

    [Column(TypeName="datetime2")]
    [Required]
    public DateTime angelegt { get; set; }

    [Column(TypeName="datetime2")]
    public DateTime? geändert { get; set; }

    public string Benutzer { get; set; }
}

```

now model:

[Table("Pfuscheraktinhalt", Schema = "dbo")]  
public partial class Pfuscheraktinhalt  
{  
[Key]  
[DatabaseGenerated(DatabaseGeneratedOption.None)]  
[Column("Akt\_ID")]  
[Required]  
public int AktId { get; set; }

```
 public Pfuscherakt Pfuscherakt { get; set; }

 \[Key\]
 \[DatabaseGenerated(DatabaseGeneratedOption.Identity)\]
 \[Column("Dokument_ID")\]
 public int DokumentId { get; set; }

 \[Column("Dokumenttyp_ID")\]
 \[Required\]
 public int DokumenttypId { get; set; }

 public Dokumenttyp Dokumenttyp { get; set; }

 \[Required\]
 \[MaxLength(255)\]
 public string Dokumentname { get; set; }

 \[Required\]
 public byte\[\] Dokumentinhalt { get; set; }

 \[DatabaseGenerated(DatabaseGeneratedOption.Computed)\]
 \[MaxLength(35)\]
 public string Dokumentgröße { get; set; }

 public bool Intern { get; set; }

 \[Column("angelegt",TypeName="datetime2")\]
 \[Required\]
 public DateTime Angelegt { get; set; }

 \[Column("geändert",TypeName="datetime2")\]
 public DateTime? Geändert { get; set; }

 \[MaxLength(100)\]
 public string Benutzer { get; set; }

```

}

here my settings from appsettings.json

"Databases": {

```
"Pdb": {

  "NoPluralize": true,

  "UseDatabaseNames": true,

  "UseEFNaming": false,

  "PrefixNavigation": false

}

```

how to have the same naming conventions as in the old model after refresh?  
because now I get hundrets of errors…  
Robert

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [September 14, 2026, 6:30pm UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/2 "2026-09-14T18:30:30Z")

</div>

Hi @Mad.Rain,

Radzen Blazor Studio reads the database settings from both appsettings.json and appsettings.Development.json, and the Development file takes precedence. If the "Databases" section there is missing or has different values, the default Entity Framework naming is used, which is what you are seeing.

Please make sure appsettings.Development.json contains the same settings:

```auto
"Databases": {
  "Pdb": {
    "NoPluralize": true,
    "UseDatabaseNames": true,
    "UseEFNaming": false,
    "PrefixNavigation": false
  }
}

```

Then refresh the model again. If the problem persists, please send us your appsettings.Development.json and the line in Program.cs that calls GetConnectionString.

---

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 15, 2026, 7:04am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/3 "2026-09-15T07:04:09Z")

</div>

I have done that - it seems that the wizard overwrites it and after using the wizard I cannot start it again (because of the errors):

 ![image](https://forum.radzen.com/uploads/default/original/3X/1/1/118aaa16690e73618593eb0218b099f92ebd18d9.png)

here my appsettings.Development.json

```auto
{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    }
  },
  "ConnectionStrings": {
    "PDBConnection": "Server=xxx;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Initial Catalog=PDB",
    "PDBAuthConnection": "Server=xxx;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Initial Catalog=PDBAuth",
    "PdbConnection": "Server=xxx;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Initial Catalog=PDB"
  },
  "IdentityServer": {
    "Clients": {
      "PdbDetektive.Client": {
        "Profile": "IdentityServerSPA"
      }
    }
  },
  "Databases": {
    "Pdb": {
      "NoPluralize": true,
      "UseDatabaseNames": true,
      "UseEFNaming": false,
      "PrefixNavigation": false
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [September 15, 2026, 7:35am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/4 "2026-09-15T07:35:38Z")

</div>

Thanks for the details! We were able to reproduce this. The wizard reads the naming options from the "Databases" section by matching the connection string name used in the AddDbContext registration in Program.cs. When it can't find a match it falls back to the defaults (EF Core naming), which is why the properties came out as AktId instead of Akt\_ID, and then it writes those defaults back to appsettings.Development.json.

There are two cases where the match fails:

1. The connection string is stored in a variable before being passed to UseSqlServer() / UseNpgsql() etc. instead of options.UseSqlServer(Configuration.GetConnectionString("PdbConnection")) inline.

2. The key under "Databases" doesn't exactly match the connection string name minus the "Connection" suffix, including letter case (e.g. PDBConnection vs. Pdb).

Could you check which one applies to your Program.cs and appsettings? As a workaround, using the inline GetConnectionString("PdbConnection") form with a Databases.Pdb key of the same casing will make the wizard pick up your settings. We will fix the lookup so that both cases work in the next release.

---

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 15, 2026, 7:47am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/5 "2026-09-15T07:47:27Z")

</div>

this look OK:

```auto
services.AddDbContext<PdbDetektive.Data.PdbContext>(options =>
            {
                options.UseSqlServer(Configuration.GetConnectionString("PDBConnection"));
            });

```

maybe it is because of this (PDB and Pdb):

```auto
 "ConnectionStrings": {
    "PDBConnection": "Server=xxx;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Initial Catalog=PDB",
 

```

```auto
"Databases": {
    "Pdb": {
      "NoPluralize": true,
      "UseDatabaseNames": true,
      "UseEFNaming": false,
      "PrefixNavigation": false
    }

```

Robert

---

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 18, 2026, 9:39am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/6 "2026-09-18T09:39:04Z")

</div>

in another project we have a similar problem so that the Wi´zard doesn’t show the existing database connection…

 ![image](https://forum.radzen.com/uploads/default/original/3X/b/4/b438aa80ea076adafc7df3d1e2517302905ec356.png)

```auto
{
  "DetailedErrors": true,
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "ConnectionStrings": {
    "GUFreigabenDBConnection": "Server=xxx;Connection Timeout=30;Command Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Initial Catalog=xxx"
  },
  "Databases": {
    "GUFreigabenDB": {
      "NoPluralize": true,
      "UseDatabaseNames": true,
      "UseEFNaming": true,
      "PrefixNavigation": true
    }
  },
  "AppSettings": {
    "KammerID": x
  },
  "Authentication": {
    "WsFederation": {
      "MetadataAddress": "xxx",
      "Wtrealm": "xxx",
      "CallbackPath": "/signin-wsfed",
      "ValidAudience": "xxx",
      "ValidIssuer": "xxx",
      "RoleSelectionUrl": "xxx"
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [September 18, 2026, 9:46am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/7 "2026-09-18T09:46:21Z")

</div>

Thanks for the follow-up. The first project is the casing case: "PDBConnection" in AddDbContext vs. the "Pdb" key under "Databases". This is fixed for the next release. Until then renaming the key to "PDB" will make the wizard pick up your settings.

The second project is a different issue. Your appsettings is fine. The wizard lists existing databases by looking for the DbContext registration in the server project, and at the moment it only recognizes this form:

`services.AddDbContext(options =>`  
`{`  
`options.UseSqlServer(Configuration.GetConnectionString("GUFreigabenDBConnection"));`  
`});`

It will not list the database if the context is registered with AddDbContextFactory, AddDbContextPool or AddPooledDbContextFactory, if the connection name is a constant instead of a string literal, if the registration lives in another project, or if the connection string is not present in appsettings.json or appsettings.Development.json. Could you post how GUFreigabenDBContext is registered in your Program.cs? We will try to extend the wizard to support these registrations as well.

---

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 18, 2026, 9:58am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/8 "2026-09-18T09:58:29Z")

</div>

```auto
builder.Services.AddDbContextFactory<GUFreigabenDBContext>(options =>
{
    options.UseSqlServer(builder.Configuration.GetConnectionString("GUFreigabenDBConnection"));
});

builder.Services.AddScoped<GUFreigabenDBCustomService>();

```

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [September 18, 2026, 1:43pm UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/9 "2026-09-18T13:43:53Z")

</div>

Thanks, that explains it. The wizard currently only detects contexts registered with AddDbContext, so a context registered with AddDbContextFactory is not listed as an existing data source. Your appsettings are correct.

We will add support for AddDbContextFactory, AddDbContextPool and AddPooledDbContextFactory in the next release. Until then you can make the wizard list the database by adding a regular registration after the factory one:

```auto
builder.Services.AddDbContextFactory(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("GUFreigabenDBConnection"));
});

builder.Services.AddDbContext(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("GUFreigabenDBConnection"));
});

```

Keep the factory registration first. Both can coexist and your GUFreigabenDBCustomService will keep working with the factory.

---

<div class="post-metadata">

**Author:** ![Mad.Rain](https://forum.radzen.com/user_avatar/forum.radzen.com/mad.rain/32/9188_2.png) [@Mad.Rain](https://forum.radzen.com/u/Mad.Rain)\
**Post date:** [September 21, 2026, 8:38am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/10 "2026-09-21T08:38:11Z")

</div>

Hello,  
Can you tell me when the fix for the first problem will be availible?

Robert

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [September 21, 2026, 8:39am UTC](https://forum.radzen.com/t/database-wizard-usedatabasenames-etc/21704/11 "2026-09-21T08:39:34Z")

</div>

It will be released in our next update later this week.
