You can either use the [ForeignKey] attribute for the actual ID values or you can just set a reference to the the object in question:
public Operator ModifiedBy {get; set; }
public Operator EnteredBy {get; set;}
This effectively creates the relationship (at least with CodeFirst).
Personally I prefer to have both the foreign key and the object reference because in some scenarios you can avoid having to load the related objects just to update the parent. You can do both if needed.
+++ Rick ---
>Hi everybody,
>
>I am trying to create classses for the existing database by coding them manually. I have EnteredBy and ModifiedBy columns in the table that both refer to the same column from Operators table. I will require an authorization and I will set these columns to the currently logged operator.
>
>My question is - when I define my class, how should I make these relations?
>
>Thanks in advance.