RIA的DomainService +的ActiveRecord [英] RIA DomainService + ActiveRecord

查看:144
本文介绍了RIA的DomainService +的ActiveRecord的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用SubSunsonic.ActiveRecord在使用.NET RIA服务SL3项目。 然而,当我试图返回的DomainService类中的一些IQuerable我得到一个错误,由亚音速生成的类有一个属性'列'与不支持的类型。 这就是我的

I tried to use SubSunsonic.ActiveRecord in SL3 project that uses .NET RIA Services. However when I try to return some IQuerable in DomainService class I get an error that the classes generated by Subsonic have a property 'Columns' with an unsupported type. That's what I have

public IEnumerable<SE_NorthWind.SuperEmployee> GetIntegers()
{
  return SE_NorthWind.SuperEmployee.All()
    .Where(emp => emp.Issues > 100)
    .OrderBy(emp => emp.EmployeeID);
}

这是我的错误

And this is the error I get

Error   7	Entity 'SE_NorthWind.SuperEmployee' has a property 'Columns' with an unsupported type.	SuperEmployee

任何想法,该怎么办?不要真的想使用LINQ到SQL:)

Any idea what to do? Don't really wanna use Linq to SQL :)

THX

P.S。只是试图从亚音速LinqTemplates,但这种方法我得到的错误

P.S. Just tried to LinqTemplates from SubSonic, but this solution I get the error

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表中有一个主键,导致由亚音速生成的类可以看到它

of course SuperEmployee table has a primary key, cause the classes generated by SubSonic can see it

...
Columns.Add(new DatabaseColumn("EmployeeID", this)
            {
                IsPrimaryKey = true,
                DataType = DbType.Int32,
                IsNullable = false,
                AutoIncrement = true,
                IsForeignKey = false,
                MaxLength = 0
            });
...

但RIA的对象,他们需要一些属性。我想我会去与当地的LINQ to SQL到亚音速适应这一切:(

But RIA objects, they need some attributes. I guess I'll have to go with native Linq To SQL until SubSonic adapts to all this :(

推荐答案

你能尝试删除[EnableClientAccess()]属性,看看你的项目将建设?

Can you try removing the [EnableClientAccess()] attribute to see if your project will build?

这篇关于RIA的DomainService +的ActiveRecord的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆