dotnet / dotnet/EntityFramework.Docs
Document when the SQLite database needs to be configured for copying to the output directory
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
I'm trying to implement the code based on console application sample but in WPF and I get the following error:

I've added the migration and updated the database. This is how my **DbContext** looks like:
```c#
public class SettingsDbContext : DbContext
{
public DbSet UserSettings { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite("Data Source=settings.db");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity(c =>
{
c.HasNoKey();
c.Property(p => p.Username);
c.Property(p => p.Password);
});
modelBuilder.Entity(c =>
{
c.HasNoKey();
c.Property(p => p.Username);
c.Property(p => p.Password);
});
}
}
```
Here is how my **Model** looks like:
```c#
public class UserSettings
{
public int Id { get; set; }
public bool RememberCredentials { get; set; }
[NotMapped]
public Client1Credentials Client1Credentials { get; set; }
[NotMapped]
public Client2Credentials Client2Credentials { get; set; }
}
```
Below you can see that the migration and database were created:

---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 7ac57b24-45aa-e679-6ff9-5a25c369c1ff
* Version Independent ID: cc576199-b14c-a135-2291-cc48bf301b4e
* Content: [Getting Started - EF Core](https://docs.microsoft.com/en-us/ef/core/get-started/?tabs=netcore-cli)
* Content Source: [entity-framework/core/get-started/index.md](https://github.com/dotnet/EntityFramework.Docs/blob/master/entity-framework/core/get-started/index.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **avickers**
Contributor guide
Assessment
This issue has not been assessed yet.