Mam modelu takich jak ten (uproszczony)Fluent NHibernate - Mapa listę ciągów
public class Post
{
public string ID { get; set; }
public string Title { get; set; }
public string Body { get; set; }
public string AuthorName { get; set; }
public List<string> Attachments { get; set; }
}
w mojej bazy danych, mam tabeli Post, oraz tabelę PostAttachment
post tabela Załącznik ma 2 kolumny:
postID AttachmentKey
(podstawy tego są takie, że przywiązanie zostanie dodane do amazon S3, więc AttachmentKey jest s3 key)
Co chcę zrobić, to odwzorować AttachmentKey do listy zwrócony/wstawionego obiektu post ...
Jak bym go o to robi?
To nie jest poprawna odpowiedź. Zobacz moją odpowiedź poniżej. HasMany (x => x.Attachments) .KeyColumn ("PostID") .Table ("PostAttachment") Element ("AttachmentKey"); – regisbsb