Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created August 30, 2018 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/0d72509b6737e398729a55726c615f6b to your computer and use it in GitHub Desktop.
Save christiannagel/0d72509b6737e398729a55726c615f6b to your computer and use it in GitHub Desktop.
Define shadow properties to access Azure Cosmos DB generated values
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Book>().Property<string>("_self").ValueGeneratedOnAdd();
modelBuilder.Entity<Book>().Property<string>("_etag").ValueGeneratedOnAddOrUpdate();
modelBuilder.Entity<Book>().Property<long>("_ts").ValueGeneratedOnAddOrUpdate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment