Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 01 13:40
    dnfadmin commented #1746
  • Oct 01 13:40
    dnfadmin commented #1746
  • Oct 01 05:23
    dnfadmin commented #1846
  • Oct 01 05:23
    dnfadmin commented #1846
  • Sep 30 01:33
    dnfadmin commented #1706
  • Sep 30 01:33
    dnfadmin commented #1706
  • Sep 29 16:22
    dnfadmin commented #2149
  • Sep 29 16:22
    dnfadmin commented #2149
  • Sep 29 09:31
    NikiforovAll commented #2360
  • Sep 29 09:31
    NikiforovAll commented #2360
  • Sep 28 21:38
    dnfadmin commented #1728
  • Sep 28 21:38
    dnfadmin commented #1728
  • Sep 28 02:11
    kuanpak opened #70
  • Sep 27 10:46
    dnfadmin commented #1580
  • Sep 27 10:46
    dnfadmin commented #1580
  • Sep 27 06:14
    dnfadmin commented #1736
  • Sep 27 06:14
    dnfadmin commented #1736
  • Sep 27 05:29
    dnfadmin commented #2006
  • Sep 27 05:29
    dnfadmin commented #2006
  • Sep 26 12:52
    NikiforovAll opened #2360
Jeremy D. Miller
@jeremydmiller
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.
anyhow, the videos are all 1+ hrs :-)
Oskar Dudycz
@oskardudycz
Let's try that then, we can always change that in the future :)
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.
Babu Annamalai
@mysticmind
yeah.