For a one-to-one relationship to exist. The primary key is the same on both entities.
On the dependent table, the primary key is also the foreign key to the related entity.
In your example:
public class ResponseSeries : TrackedEntity
{
public ResponseSeries()
{
Responses = new Collection<Response>();
}
public Int32 ResponseSeriesId { get; set; }
public virtual TabletUserSession TabletUserSession { get; set; }
public virtual ICollection<Response> Responses { get; set; }
}
public class TabletUserSession : TrackedEntity
{
// this should not exist
public Int32 TabletUserSessionId { get; set; }
// this should be the primary key of this entity
// it is also the foreign key to the ResponseSeriesId
public Int32 ResponseSeriesId { get; set; }
public Int32? TabletId { get; set; }
public DateTime StartDate { get; set; }
public DateTime? ClosedDate { get; set; }
public virtual Tablet Tablet { get; set; }
public virtual ResponseSeries ResponseSeries { get; set; }
}
ResponseSeriesId is the primary key and is the prinicpal entity in the relationship. In this case, the primary key of your TabletUserSession entity needs to be ResponseSeriesId. It does not have an identity of its own, because otherwise it's not really one to zero or one.