Skip to content

Instantly share code, notes, and snippets.

@xuzhg
Last active November 28, 2019 13:35
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 xuzhg/f2e9d6d1f66c4f82be1e4d4824277cd3 to your computer and use it in GitHub Desktop.
Save xuzhg/f2e9d6d1f66c4f82be1e4d4824277cd3 to your computer and use it in GitHub Desktop.
BookStoreContext.cs
public class BookStoreContext : DbContext
{
public BookStoreContext(DbContextOptions<BookStoreContext> options)
: base(options)
{
}
public DbSet<Book> Books { get; set; }
public DbSet<Press> Presses { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Book>().OwnsOne(c => c.Location);
}
}
@fabriziogelsi
Copy link

No. My header's response is: Content-Type application/json; charset=utf-8
I was wondering if I should receive a header like this: "application/json; odata.metadata=minimal; odata.streaming=true".
I will check again, but I've just copied your sample, so I don't understand why is not working :S. I'm using VS2019 too.

@J0rgeSerran0
Copy link

Great @xuzhg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment