SHARE
TWEET

Untitled

a guest Jun 16th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public abstract class File
  2. {
  3.     [Key]
  4.     public string fileName { get; set; }
  5.     public double size{ get; set; }
  6. }
  7.  
  8. public class SubFile: File
  9. {
  10.     public string secondName{ get; set; }
  11. }
  12.  
  13. public class MyContext : DbContext
  14. {
  15.     public DbSet<SubFile> subFile{ get; set; }
  16. }
  17.      
  18. var sb = new SubFile{ fileName = "test.doc" };
  19. sb.secondName= "test2.doc";
  20.  
  21. using (var db = new MyContext())
  22. {
  23.     db.SubFile.Add(sb);
  24.     db.SaveChanges();
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top