无法通过Silverlight和RIA加载存储过程

时间:2011-11-14 06:20:10

标签: c# silverlight stored-procedures domainservices objectcontext

我想将返回转储到silverlight应用程序的datagrid中。我写了一个没有键的存储过程,只返回4个属性。我已使用

将该功能导入Entity Framework
  • 功能导入名称:: LecAllInfo
  • 存储过程名称:: LecAllInfo
  • 返回:: Complex的集合:LecAllInfo_Result
  • 存储过程列信息

    StartTime, EndTime, Venue, Purpose
    

我的域服务类(OrganizationService.cs)中的代码

    public IQueryable<LecAllInfo_Result> LecAllInfoQuery(string lecId)
    {
        return this.ObjectContext.LecAllInfo(lecId).AsQueryable<LecAllInfo_Result>();
    }

我的元数据中的代码(OrganizationService.metadata.cs)

[MetadataTypeAttribute(typeof(LecAllInfo_Result.LecAllInfo_ResultMetadata))]
public partial class LecAllInfo_Result
{
    internal sealed class LecAllInfo_ResultMetadata
     {
          private LecAllInfo_ResultMetadata()
          {
          }

          public DateTime StartTime { get; set; }
          public DateTime EndTime { get; set; }
          public string Venue { get; set; }
          public string Purpose { get; set; }
     }
}

但我没有以通常的方式回调LecAllInfo,即::

var context = new OrganizationContext();
context.Load(context.GetLecNotificationQuery(((App) Application.Current).GloUid), loadLectNort, null);
context.Load(context.Lec << Unable to Load it
  

context.Load(context.LecAllInfo(“LP123112”),true);

     

将返回错误和resharper告诉   我在'OrganizationContext.LecAllInfo'中创建方法

我可能知道我的代码结构有什么问题吗?我怎么能编辑它而我不知道如何制作它?

当我点击resharper选项时,它在SolutionName.Web.g.cs

创建了它
    public EntityQuery<object> LecAllInfo(string lp123112)
    {
        throw new NotImplementedException();
    }

我在网上发布了几个教程,stackoverflow成员也发布了,但仍未能这样做。谢谢你的回复

1 个答案:

答案 0 :(得分:0)

要加载存储过程,应将任何内容定义为键。解决

相关问题