Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created Aug 30, 2018
Embed
What would you like to do?
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