3つのselectステートメントを持つストアドプロシージャがあります。
select col1, col2 from table1
select col1, col2 from table2
select col1, col2 from table3
次のように、テーブルごとに3つのモデルを作成しました。
public class table1
{
public string col1 { get; set; }
public string col2 { get; set; }
}
public class table2
{
public int col1 { get; set; }
public int col2 { get; set; }
}
public class table3
{
public decimal col1 { get; set; }
public decimal col2 { get; set; }
}
そして、次のようなこれらのモデルのリストを含む別のモデル:
public class mymodel
{
public IEnumerable<table1> table1 { get; set; }
public IEnumerable<table2> table2 { get; set; }
public IEnumerable<table3> table3 { get; set; }
}
私は次のように記入しようとしmymodelています:
var model = context.ExecuteStoreQuery<mymodel>("sproc1").FirstOrDefault();
しかし、mymodel常に、、およびを持っていnullます。table1table2table3
どうすればこれを達成できますか?EF4はそれをサポートしていますか?