using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
public Guid? Id { get; set; }
public string? Title { get; set; }
public class BloggingContext : DbContext
public BloggingContext(){ }
public BloggingContext(DbContextOptions<BloggingContext> options)
protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<Blog>();
static void Main(string[] args)
Console.WriteLine("This is an example of using EF Core InMemory Database");
Console.WriteLine("======================================================");
var options = new DbContextOptionsBuilder<BloggingContext>()
.UseInMemoryDatabase(databaseName: "blarg123")
using (var context = new BloggingContext(options))
var blog = new Blog { Id = 1, Name = "http://sample.com", RowVersion = new byte[] { 01 } };
context.Set<Blog>().Add(blog);