Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 02 21:31
    Leh2 opened #2413
  • Dec 02 21:31
    Leh2 opened #2413
  • Dec 02 13:51
    jeremydmiller commented #2412
  • Dec 02 13:51
    jeremydmiller commented #2412
  • Dec 02 07:32
    Leh2 ready_for_review #2409
  • Dec 02 07:32
    Leh2 ready_for_review #2409
  • Dec 02 06:50

    github-actions[bot] on gh-pages

    Documentation Update for 7.2.1 (compare)

  • Dec 02 06:49

    github-actions[bot] on v7.2.1

    (compare)

  • Dec 02 06:44

    Hawxy on master

    Improve assertion documentation… (compare)

  • Dec 02 06:34
    Hawxy closed #128
  • Dec 02 06:34

    Hawxy on master

    Fix single header assertion wit… (compare)

  • Dec 02 06:34
    Hawxy closed #129
  • Dec 02 06:29
    Hawxy commented #128
  • Dec 02 06:27
    Hawxy synchronize #129
  • Dec 02 06:24
    Hawxy edited #129
  • Dec 02 06:19
    Hawxy opened #129
  • Dec 02 04:33
    Hawxy assigned #128
  • Dec 01 22:26
    joshuaflanagan opened #2412
  • Dec 01 22:26
    joshuaflanagan opened #2412
  • Dec 01 18:58

    github-actions[bot] on v5.0.0

    (compare)

Jeremy D. Miller
@jeremydmiller
2 replies
Why do you need that at append time by the way?
Kenny
@campaignkenny_twitter

attempting use the upsert marten/postgres feature, and running into an issue where my old model and new model have the same id -> System.InvalidOperationException: Document 'Bob.Projections.ActivityModel' with same Id already added to the session.

i would ideally like to reuse the same Id if possible. code below

    var oldModel = await GetById(organizationId, cancellationToken);

    // attempt upsert
    _documentSession.Store(model, oldModel);
Babu Annamalai
@mysticmind
Did you persist the old model already? Or is it all happening in a set of code prior to save changes?
In a session (unit of work), prior to save changes, you can’t have 2 model instances with the same Id
Babu Annamalai
@mysticmind

You could just do the below:

_documentSession.Store(model);

In this case, this will update the existing one if it exist or insert a new one if it does not exist.

Marten will match by id to update or insert accordingly.
Oskar Dudycz
@oskardudycz
@mysticmind @jeremydmiller maybe we could add them to docs? We were talking about that, but now we have a fresh and up to date versions. Maybe on the quick start or in the dedicated one?
Babu Annamalai
@mysticmind
Yes @oskardudycz, it is a good idea to add these to our docs.
Oskar Dudycz
@oskardudycz
Babu, what's your thoughts on where to put them?
Do you have some preference?
Babu Annamalai
@mysticmind
thinking, will revert shortly...
Let us add it to "Marten as EventStore" page
If we have more talks as we go, we can add a dedicated page.
Oskar Dudycz
@oskardudycz
:+1: Sounds good to me. I'll try to send PR today
Babu Annamalai
@mysticmind
cool Oskar!
An alternative idea, have a dedicated page with the current list of talks and then add the links in the corresponding main pages
we have 3 currently, the old one on document db, and the 2 new recent ones.
Oskar Dudycz
@oskardudycz
Or maybe we could put the Jeremy's talks as the single one on the quick starts
and dedicated page with all?
Babu Annamalai
@mysticmind
that sounds okay.
Oskar Dudycz
@oskardudycz
I think that's nice for someone to get straight possibility to skim through the recording when they're trying to investigate Marten for the first time
Indeed a few videos in quick start could be too overwhelming
Babu Annamalai
@mysticmind
yes, that makes sense.
Oskar Dudycz
@oskardudycz
Let's try that then, we can always change that in the future :)
Babu Annamalai
@mysticmind
anyhow, the videos are all 1+ hrs :-)
Oskar Dudycz
@oskardudycz
I think that we could also record a shorter one
later on
with really quick start :)
Babu Annamalai
@mysticmind
yes!
Also I would want to add your quote "Event Sourcing is not difficult but a bit different"
Oskar Dudycz
@oskardudycz
:)
Babu Annamalai
@mysticmind
It quite a neat one to galvanize someone's mind to give it a deep thought.
Oskar Dudycz
@oskardudycz
Yeah, from my experience once people see Event Sourcing code with explanation the reaction is "well, that's not that hard as I heard". Of course, then once you're getting your hands dirty you need to shift your mindset a bit, but it's really not that hard :)
Especially with Marten :D
Babu Annamalai
@mysticmind
true!
Once someone gets their hand dirty, we can transpose our quote to "Your mileage may vary but everything is a still a bit different and not difficult" :-)
Oskar Dudycz
@oskardudycz
:)
Oskar Dudycz
@oskardudycz
I just watched @jeremydmiller's talk. I like it a lot, especially the Jasper integration as the sprinkle on top :)
It's nice, that we were showing similar things, but from different angles and a different, but complementary way, so I think watching both of them gives a good holistic starting point :)
Babu Annamalai
@mysticmind
I also watched @jeremydmiller's talk and he packed a lot of concepts and usage with regards to Marten. I got a good intro on Jasper + Marten which is going to get more traction due its simplicity.
Overall, both the talks are awesome and provides good chunk of intro into the world of Marten. :clap:
Oskar Dudycz
@oskardudycz
Thanks Babu :)
chathamcoders
@chathamcoders_twitter

hi, is there a lightweight way to determine if a model exists doing the below? was expecting something like session.Any<SomeModel>(someId) etc

_documentSession.LoadAsync<SomeModel>(someId, innerCancellationToken);

Oskar Dudycz
@oskardudycz
Hi, could you expand on lightweight? :)
Babu Annamalai
@mysticmind
Looks like he is wanting to check whether a document exist or not, without fetching any doc.
Babu Annamalai
@mysticmind
session.Query<SomeModel>().Where(x => x.Id == someId).Select(x => new { Id = x.Id }).SingleOrDefault() - This would be a way to fetch minimal document data using a Select projection by returning just the Id
1 reply
Oskar Dudycz
@oskardudycz
I think that indeed, we could add some synctactic sugar to support Exists method.