无法通过 Silverlight 和 RIA 加载存储过程
我想将返回转储到 silverlight 应用程序的数据网格中。我编写了一个没有键的存储过程,只返回 4 个属性。 将函数导入到实体框架中
- 我已使用Function Import Name :: LecAllInfo
- Stored procedure Name :: LecAllInfo
- Returns a Collection of :: Complex : LecAllInfo_Result
Stored procedure Column Information
开始时间、结束时间、地点、目的
我的域服务类中的
public IQueryable<LecAllInfo_Result> LecAllInfoQuery(string lecId)
{
return this.ObjectContext.LecAllInfo(lecId).AsQueryable<LecAllInfo_Result>();
}
代码(OrganizationService.cs)我的元数据中的代码(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);
将返回错误并重新锐化告诉 我在“OrganizationContext.LecAllInfo”中创建方法
我可以知道我的代码结构有问题吗?或者我如何编辑它,而我不知道如何制作它?
当我单击 resharper 选项时,它在 SolutionName.Web.g.cs 上创建了此选项。
public EntityQuery<object> LecAllInfo(string lp123112)
{
throw new NotImplementedException();
}
我遵循了网络上提供的几个教程,stackoverflow 成员也发帖,但仍然未能这样做。谢谢您的回复
I want to dump the return into datagrid of silverlight application. I wrote a stored procedure with no key and just return 4 properties. I have imported the function into Entity Framework with
- Function Import Name :: LecAllInfo
- Stored procedure Name :: LecAllInfo
- Returns a Collection of :: Complex : LecAllInfo_Result
Stored Procedure Column Information
StartTime, EndTime, Venue, Purpose
Code in my Domain Service Class (OrganizationService.cs)
public IQueryable<LecAllInfo_Result> LecAllInfoQuery(string lecId)
{
return this.ObjectContext.LecAllInfo(lecId).AsQueryable<LecAllInfo_Result>();
}
Code in my Metadata (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; }
}
}
But I failed to call back the LecAllInfo in usual way, which is ::
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);
will return error and resharper telling
me to create method in 'OrganizationContext.LecAllInfo'
May I know is there something wrong with my structure of code or how can i edit this while i got no idea on how to make it ??
when i click the resharper option, it created this at SolutionName.Web.g.cs
public EntityQuery<object> LecAllInfo(string lp123112)
{
throw new NotImplementedException();
}
I followed several tutorial available on web, stackoverflow members post as well but still failed to do so. Thank you for reply
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要加载存储过程,应将任何内容定义为返回的键。已解决
To load Store Procedure should define anything as key in return. SOLVED