Coder Social home page Coder Social logo

Comments (16)

thiagolunardi avatar thiagolunardi commented on May 22, 2024

Can you provide more info about your database?
Are you trying just to run Equinox at your environment, or it's something else?

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

I have an existing very complicated DB. That's why I already asked a more complicated sample with more than one Entity which it should have one-one and one-many relation as well.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

Ok, let me see how I can help.
You don't need to use Guid as Id, it's not an obligation.
You just need to map the entity properly at your Data Context project.

Asking for a more complex sample is too generic and it will not happen, it's not planned.
But, if you share one small piece of problem at time, we may try to help.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

YES. Thanks. I get lost when I have to monitor events for a complex scenario. I wish it had more than one Model class and handled relations as a sample.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

Can you write a small sample snipped here? Then we can go deep on it.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

1- Some tables do not have GUID as Primary-key and it is integer for example.
2- Entities have relation so I am not sure about how to define a new Event handler for the other Entity.

I did change the AggreatorID from GUID to string and work fine , but I do not know what to do if my table does not have a GUID primary key.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

If I use anything other than GUID as a primarykey, then how to assign to the aggrigatorID ?

public Persons(Guid id, string name, string family, string address)
{
Id = id;
Name = name;
Family = family;
Address = address;
}

the type would be different then.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

It's important that you may use one EventSource entity per Domain entity.
So, if the domain entity has Guid Id, the AggrigatorId will be Guid, is it's int, so both should be int.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

but I do inherit from Entity class which has a GUID ID in the base class.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

Just remove te Guid Id property from Entity class, and bring it to each Entity specific class.
Your are adjusting, so, ofc, you need to do a few dirty job me make it work.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

so if the primarykey name was not ID and it was not GUID, the aggregateid would not work.Correct?.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

The idea behind the aggregateId is just to keep track on changes through eventsourcing. Just create a Guid.New for it and you will be fine.

They don't need to be the same, just need to have one aggregateid per one Entity.

Imagine if you have compose key for an entity, you don't create a compose aggregateid , just keep one-to-one relation.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 22, 2024

@AliCharper May we close this discussion?

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

I think so, but I have so many other questions which I would ask later.

from equinoxproject.

EduardoPires avatar EduardoPires commented on May 22, 2024

If you have an Int key for your tables just change it to Int in this sample.
If you have N kinds of keys you can try using a generic datatype passing by the repository configuration like:

public class Repository<TKey, TEntity>

And set your datatype keys as you like.

from equinoxproject.

AliCharper avatar AliCharper commented on May 22, 2024

Imagine if you have compose key for an entity, you don't create a compose aggregateid , just keep one-to-one relation.

Yes, but imagine that I have an existing DB which has so many tables with IN primarykeys or Composite ones. then how can I assign a GUID as an aggregateId ?.

from equinoxproject.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.