.NET RIA サービスを使用する SL3 プロジェクトで SubSunsonic.ActiveRecord を使用しようとしました。ただし、DomainService クラスで IQuerable を返そうとすると、Subsonic によって生成されたクラスに、サポートされていない型のプロパティ 'Columns' があるというエラーが表示されます。それが私が持っているものです
public IEnumerable<SE_NorthWind.SuperEmployee> GetIntegers()
{
return SE_NorthWind.SuperEmployee.All()
.Where(emp => emp.Issues > 100)
.OrderBy(emp => emp.EmployeeID);
}
そして、これは私が得るエラーです
Error 7 Entity 'SE_NorthWind.SuperEmployee' has a property 'Columns' with an unsupported type. SuperEmployee
どうすればいいですか?Linq to SQL を本当に使いたくない :)
どうも
PS SubSonic から LinqTemplates を試みましたが、このソリューションではエラーが発生します
Error 4 The entity 'SE_NorthWind.SuperEmployee' does not have a key defined. Entities exposed by DomainService operations must have must have at least one property marked with the KeyAttribute. SuperEmployee
もちろん、SuperEmployee テーブルには主キーがあります。これは、SubSonic によって生成されたクラスがそれを見ることができるためです。
...
Columns.Add(new DatabaseColumn("EmployeeID", this)
{
IsPrimaryKey = true,
DataType = DbType.Int32,
IsNullable = false,
AutoIncrement = true,
IsForeignKey = false,
MaxLength = 0
});
...
しかし、RIA オブジェクトにはいくつかの属性が必要です。SubSonicがこれらすべてに適応するまで、ネイティブのLinq To SQLを使用する必要があると思います:(