I use Code First Entity Framework 6.0 approach and have BaseClass and some of DerivedClasses. I used to manually update database (all tables derived from BaseClass).
I want to update (doesn't matter where) data 1 time.
Classes:
public class IItem {
public int Id {
get;
set;
}
public string Model {
get;
set;
}
public int Cost {
get;
set;
}
//other properties
}
public class MotherBoard : IItem {
public string Manufacturer {
get;
set;
}
public string FormFactor {
get;
set;
}
public string CPUManufacturer {
get;
set;
}
public string Socket {
get;
set;
}
public int SocketCount {
get;
set;
}
//other properties
}
//there are 3 more classes
Ef context:
public class EFDbContext : DbContext {
public IDbSet<MotherBoard> MotherBoards {
get;
set;
}
public IDbSet<Processor> Processors {
get;
set;
}
public IDbSet<VideoCard> VideoCards {
get;
set;
}
//other
}