Skip to content

Realm and ASP.NET Core #3331

Answered by nirinchev
darcome asked this question in Q&A
May 26, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey, yes, Realm is supported on ASP.NET Core, even if it's not our primary use case.

  1. Yes, concurrency is supported, though you need to be careful to always open a new Realm instance per thread (typically, that'll translate per request in ASP.NET).
  2. There's nothing special about setting it up - you'll probably want to set it up to work with whatever DI framework you use to open and close a new Realm instance for each request.
  3. The main pitfall is that a single Realm instance may only be used on the same synchronization context/thread. Since ASP.NET by default doesn't have a synchronization context installed, you'll either need to make sure you don't do any async work in the request handler …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@darcome
Comment options

Answer selected by darcome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants