Skip to main content
edited tags
Link
Antonio Carlos Ribeiro
  • 87.9k
  • 22
  • 220
  • 205
added 115 characters in body
Source Link
Ben
  • 270
  • 1
  • 11

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

EDIT:

The comment has to of been made by User A. The relationship of the User who made the Comment to Post isn't a direct one. It would go through the Comment table.

RE EDIT:

Would it also be possible to say have distinct Posts? Rather than return 3 of the same Post Object?

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

EDIT:

The comment has to of been made by User A. The relationship of the User who made the Comment to Post isn't a direct one. It would go through the Comment table.

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

EDIT:

The comment has to of been made by User A. The relationship of the User who made the Comment to Post isn't a direct one. It would go through the Comment table.

RE EDIT:

Would it also be possible to say have distinct Posts? Rather than return 3 of the same Post Object?

added 176 characters in body
Source Link
Ben
  • 270
  • 1
  • 11

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

EDIT:

The comment has to of been made by User A. The relationship of the User who made the Comment to Post isn't a direct one. It would go through the Comment table.

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

I need to be able to specify conditions on a relationship (one-to-many).

Example being; We have a Post which has many Comments, but I only want the Posts with Comments made by User A and then return the Post object(s).

The only way I can currently think of doing this is with a Fluent query, which wouldn't return the Post object I desire!

EDIT:

The comment has to of been made by User A. The relationship of the User who made the Comment to Post isn't a direct one. It would go through the Comment table.

Source Link
Ben
  • 270
  • 1
  • 11
Loading