このViewModelを考える
public class DocumentReferenceViewModel
{
public int IdDocumentReference { get; set; }
public string DocumentTitle { get; set; }
public string PageNbr { get; set; }
public string Comment { get; set; }
}
- DocumentTitle はDocumentオブジェクトのプロパティです
- IdDocumentReferenceとPageNumberは DocumentReference オブジェクトのプロパティです
DocumentとDocumentReferenceはプロパティIdDocumentでリンクされています
- Documentオブジェクトを返すことができるリポジトリがあります
- DocumentReferenceオブジェクトを返すことができるリポジトリがあります
public class DocumentReference
{
public int IdDocumentReference;
public string PageNbr { get; set; }
public string Comment { get; set; }
}
public class Document
{
public int IdDocument;
public string DocumentTitle { get; set; }
}
DocumentReference をループせずにこれらの 2 つのオブジェクト (テーブル) から ViewModel をバインドするにはどうすればよいでしょうか。
ps : 私は EF を使用していません。手書きのストアド プロシージャを呼び出すリポジトリがあります。