It appears you are trying different data providers so why not EF Core?
I would recommend experimenting outside the current project using a console project then once satisfied incorporate code into your project.
In the following code sample we start with a model
public class FileContainer
{
public int Id { get; set; }
public string Path1 { get; set; }
public string Path2 { get; set; }
public string Path3 { get; set; }
}
Then a class inheriting DbContext which in this case will point to a database in the app folder.
public class Context : DbContext
{
public DbSet<FileContainer> FileContainers { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseSqlite("Data Source=files.db");
}
Then code in Program.cs
internal partial class Program
{
static void Main(string[] args)
{
using (var context = new Context())
{
BuildData(context);
ShowData(context);
UpdateOneRecord(context);
ShowData(context);
}
Console.ReadLine();
}
/// <summary>
/// First two lines create the db each time the app runs
/// Once created feel free to remove the first line to keep existing data
/// </summary>
private static void BuildData(Context context)
{
context.Database.EnsureDeleted();
context.Database.EnsureCreated();
context.FileContainers.Add(new FileContainer() { Path1 = "A1", Path2 = "A2", Path3 = "A3" });
context.FileContainers.Add(new FileContainer() { Path1 = "B1", Path2 = "B2", Path3 = "B3" });
context.FileContainers.Add(new FileContainer() { Path1 = "C1", Path2 = "C2", Path3 = "C3" });
context.SaveChanges();
}
/// <summary>
/// Update a record
/// </summary>
private static void UpdateOneRecord(Context context)
{
var item = context.FileContainers.FirstOrDefault(x => x.Id == 2);
Console.WriteLine();
item!.Path1 = Prompts.GetPath();
context.SaveChanges();
}
private static void ShowData(Context context)
{
Console.WriteLine();
var items = context.FileContainers.ToList();
foreach (var container in items)
{
Console.WriteLine($"{container.Id,-3}{container.Path1,-20}{container.Path2,-13}{container.Path3,-13}");
}
}
}
Note I use a third party NuGet package to prompt for a string
internal class Prompts
{
public static string GetPath() =>
AnsiConsole.Prompt(
new TextPrompt<string>("[white]Enter new path[/]?")
.PromptStyle("yellow"));
}