Question

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

Était-ce utile?

La solution

To load Store Procedure should define anything as key in return. SOLVED

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top