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

本文关键字:RIA 加载 存储过程 Silverlight | 更新日期: 2023-09-27 18:14:35

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

将函数导入实体框架
  • 功能导入名称::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"),真的);

将返回错误和更清晰的提示我在OrganizationContext中创建方法。LecAllInfo '

我可以知道我的代码结构是否有问题,或者我如何编辑这个,而我不知道如何制作它??

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

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

我遵循了网上的几个教程,stackoverflow成员的帖子也是如此,但仍然失败了。感谢您的回复

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

加载存储过程应该定义任何返回的键。解决了