Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 15 17:42
    mysticmind milestoned #1385
  • Nov 15 17:42
    mysticmind milestoned #1385
  • Nov 15 17:42
    mysticmind assigned #1385
  • Nov 15 17:42
    mysticmind assigned #1385
  • Nov 15 17:41
    mysticmind labeled #1385
  • Nov 15 17:41
    mysticmind labeled #1385
  • Nov 15 17:41
    mysticmind labeled #1385
  • Nov 15 17:41
    mysticmind labeled #1385
  • Nov 15 17:21
    mysticmind milestoned #1388
  • Nov 15 17:21
    mysticmind milestoned #1388
  • Nov 15 17:20
    mysticmind labeled #1388
  • Nov 15 17:20
    mysticmind labeled #1388
  • Nov 15 17:19
    mysticmind commented #1386
  • Nov 15 17:19
    mysticmind commented #1386
  • Nov 15 17:19
    mysticmind commented #1386
  • Nov 15 17:19
    mysticmind commented #1386
  • Nov 15 17:17
    mysticmind commented #1386
  • Nov 15 17:17
    mysticmind commented #1386
  • Nov 15 17:13
    jeremydmiller commented #1388
  • Nov 15 17:13
    jeremydmiller commented #1388
Oskar Dudycz
@oskardudycz
unfortunately I'm not going, although I have Vilnius on my list of place to visit ;)
Joona-Pekka Kokko
@jokokko
it's a nice city. At least during summer. Though I'm not from there (or Lithuania). And Build Stuff is a nice conference. Established by Greg Young I believe
been to one of his trainings in Vilnius
Oskar Dudycz
@oskardudycz
oh nice, I've been talking with him last week, he said that he was living there for 10 years
I saw recording of one of the meetings in Vilnius
I heard only good words about the Build Stuff Vilnius, maybe next year :)
Joona-Pekka Kokko
@jokokko
:thumbsup: not pricey for attendees. As far as conferences go
Oskar Dudycz
@oskardudycz
are you going this year?
Joona-Pekka Kokko
@jokokko
yes, that is the plan
Oskar Dudycz
@oskardudycz
The line-up looks impressive :)
a hint - Mark Rendle is doing good show :)
Jeremy D. Miller
@jeremydmiller
Mark’s got tons of personality
Oskar Dudycz
@oskardudycz
I confirm :)
ddivita
@ddivita
When using Dependency Injection to instantiate a document session, what is the best way to inject a tenant id? Is it better to set the tenant after the session has been constructed? Is that possible by setting the session.Tenantproperty? I am using .Net Core 3 preview 7
Oskar Dudycz
@oskardudycz
@ddivita currently you need to pass it to the OpenSession initialization
we're considering making possibility to have it per operation or document, but at this moment you'd need to include it in the document session initialization in DI
services.Add(sp =>
            {
                var store = sp.GetService<DocumentStore>();
                var tenant = sp.GetService<ITenantProvider>();
                return store.OpenSession(tenant.TenantId);
            }, serviceLifetime);
something like that
ddivita
@ddivita
@oskardudycz , I figured as much. So with that said, what is the best approach to inject into a session. Considering the sessions are transient or scoped in the DI, we can pump in the tenant ID. I suppose I can pull the tenant ID off the logged in user or use a service to get the tenant
Oskar Dudycz
@oskardudycz
where ITenantProvider is your custom interface or other class that will return the tenant (eg. from http request)
ddivita
@ddivita
@oskardudycz , yep. That is what I was thinking!!!
Oskar Dudycz
@oskardudycz
:+1:
I personally was using that pattern in my application
ddivita
@ddivita
Awesome!! Good to know
Oskar Dudycz
@oskardudycz
:)
Matt Prigge
@mprigge
Are there any good examples of utilizing marten-based event sourcing in distributed systems? This may be a really basic question - I apologize for that. I am very new to Marten. I'm trying to determine how Service B would be able to read events generated by Service A in a read-only fashion (to build a read model which incorporates some of Service A's events). Is that kind of use case supported?
Oskar Dudycz
@oskardudycz
@mprigge I'm currently working on it in my sample repo https://github.com/oskardudycz/EventSourcing.NetCore
Matt Prigge
@mprigge
Oh, no kidding. Do you mean you're working on support for it or an example of how to implement it?
Oskar Dudycz
@oskardudycz
on example
it's ongoing, not yet finished
but basic integration with Kafka showing how to publis events from Marten through => MediatR (internal message Bus) => Kafka (External bus) => Elastic read model
it's already there
I'm also working on self-paced event sourcing training, basic exercies are already there also
Matt Prigge
@mprigge
Excellent. That's the sort of thing that really lets people jump into a new project. Great that you're doing that work! I will take a look. FWIW, I've found reading through your GoldenEye repo really useful as well.
Oskar Dudycz
@oskardudycz
Thank you :)
there is also sample there
but with non-distributed
If you have any questions feel free to ask here on on PM/email
If you have also some ideas suggestion what might be useful I'm also open :)
Matt Prigge
@mprigge
Thank you! That'e extremely kind of you to offer!
Jay Stevens
@jediwarpraptor
Good evening guys. Has anyone attempted to put a MongoDB wire-compatible gateway in front of Marten yet?
JT
@Hawxy
Hello, is there a preferred way to get a single document from a single tenant without setting the tenant in the session? I was thinking something like await _session.Query<TDocument>().Where(x => x.TenantIsOneOf(tenant) && x.Id == id).SingleOrDefaultAsync();
Jeremy D. Miller
@jeremydmiller
That’s an “I take pull requests” kind of question I think;)
And you’d want to do that outside of Linq to make it easier.
Babu Annamalai
@mysticmind
@Hawxy https://jasperfx.github.io/marten/documentation/documents/tenancy/basicoperations/ - you can examples of usage with and without passing tenant in session in the Default Tenancy section. Remember that if you did not pass tenant while creating a session, you may need to use TenantIsOneOf in all your LINQ queries.
Michael Lehto
@Leh2
What's the best way to determine if a document is deleted (when using soft deletes and using MaybeDeleted())? With version we have VersionedWith(x => x.Version), but can't find a equivalent for soft deletes.
Oskar Dudycz
@oskardudycz
@Leh2 Marten.Linq.SoftDeletes.MaybeDeleted or Marten.Linq.SoftDeletes.IsDeleted doesn't work?