SHARE
TWEET

Untitled

a guest Jun 25th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. services.AddDbContext<TempContext>(options => options.UseInMemoryDatabase("ImageDataBase"));
  2.      
  3. public class TempContext : DbContext
  4. {
  5.   public TempContext(DbContextOptions options) : base(options)
  6.   { }
  7.  
  8.   public DbSet<Images> Images { get; set; }
  9.      
  10. public class PathImages
  11. {
  12.   public int Id { get; set; }
  13.   public string RawImage { get; set; }
  14.   public string ProcessedImage { get; set; }
  15. }
  16.      
  17. _context.Images.RemoveRange(_context.Images.ToArray());
  18. await _context2.SaveChangesAsync();
  19.      
  20. await _context.Database.EnsureDeletedAsync();
  21.      
  22. await _context.Database.EnsureCreatedAsync();
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top