Shaun Luttin
Shaun Luttin

Reputation: 141512

How do I get the owner of an Orchard ContentItem programmatically?

What I am looking for is equivalent to this:

IUser owner = someContentItem.Owner;

Upvotes: 1

Views: 351

Answers (1)

Piotr Szmyd
Piotr Szmyd

Reputation: 13366

IUser owner = someContentItem.As<ICommonPart>().Owner;.

Your item needs to have CommonPart attached (which should almost always be the case) in order to use this.

Upvotes: 3

Related Questions