Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:32:37+00:00 2026-05-24T06:32:37+00:00

my application uses CQRS, I have a case where I have a command AddApplicationToGroupCommand

  • 0

my application uses CQRS, I have a case where I have a command “AddApplicationToGroupCommand” with following parameters:

class AddApplicationToGroupCommand
+ Guid GroupId; // AggregateRootId
+ string ApplicationName;

This command pass through my aggregate, then an event is published; handled in my EventHandler and finally persisted in my database.

My question is about best practices. What I want in the end is that my EventHandler insert in the table application with the following parameters

Table Applications
int ApplicationId
varchar(255) ApplicationName
varcher(255) GroupName

As you see, I need the GroupName when I’m gonna insert in the table. So in order to do this, I’m in front of two ways of doing this.

Either I pass my groupId as I’ve done above, then in my EventHandler, I’ll have to query my Group table in order to retrieve the name of groupId.
Either I pass GroupName in my command’s parameters above, then in my eventHandler I can directly do

myContext.Applications.Insert(applicationName, groupName)

What says CQRS ?

Thanks guys.

[Edited for more clarification about my goal]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:32:38+00:00Added an answer on May 24, 2026 at 6:32 am

    I’d suggest it’s more about your domain rather than CQRS.

    If you’re following DDD, then it would depend on aggregates – is the Group a seperate Aggregate ? If so then yes you’ll be dealing with Ids (generally) and would look up the releveant data in your command using a Reporting query to find the name.

    If it’s not a different aggregate then having the group name available doesn’t violate such issues.

    I would also argue whether an aggregate or not the above are best-practice guidelines, there’s no silver hammer. Or, slightly more clearly, if you really need the group name, pass it in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application uses the following code : #if MAC_OS_X_VERSION_10_5 < MAC_OS_X_VERSION_MAX_ALLOWED NSArray *globalPreferencePanes =
My application uses the following codes to connect to web site and download a
My application uses Django non-rel . I don't have access to model. I have
Application uses Entity Framework 4.1 with database first approach. I have in database a
My application uses an UITextView . Now I want the UITextView to have a
My application uses NHibernate with a session per request implementation. I have a core
Our application uses the MapMaker class from Google collections, and we're getting the exception
My application uses the following NSApplicationDelegate function. - (void)application:(NSApplication*)sender openFiles:(NSArray*)filenames; I want to use
My application uses the 'twisted.web.client.Agent' to get web content. But the Agent class requires
My application uses UITabBarController with 4 tabs. Each tab will have a UIWebView along

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.