I want to have a list of string and save and load them to/from database using EF-CodeFirst. this is my DbContext class:
public class KeysDbContext : DbContex
You cannot have a DbSet<string>
. String is treated as a primitive type by EF and the type for the DbSet has to be an entity. Entity has properties (which usually are mapped to columns in database) and also have to have keys. If, in your database you have a table that has just one string column you would have to create an entity with a string property to model this. In addition the string property will have to be a key property.