locked
Lightswitch RIA Service attributes RRS feed

  • Question

  • Hi,

    I am trying to create a class association using annotation/attributes in RIA service and stumbled upon the following issue when

    creating the datasource in Lightswitch:

    "The datatype ICollection is not supported..." 

    Any thoughts on how to overcome this are welcome.

    public partial class Job
          {
            [Key]
             public int JobId {get;set;}
       
             public int JobKilometerDistance {get;set;}
            
             public string JobType {get;set;}
            
             [Association("FK_CA_JO", "JobId", "ActivityJobId")]
             public ICollection<Activity> Activities
             {
                 get {  return _activities; }
        
                 set { _activities = value;}
             }
             private ICollection<Activity> _activities;
               
         }
     public partial class Activity
         {
             [Key]
              public int ActivityId {get;set;}
              
             [Association("FK_CA_JO", "ActivityJobId", "JobId",IsForeignKey=true)]
              public Job ActivityJob { get; set; }
        
              public int ActivityJobId
              {
      :           get { return _activityJobId; }
                  set
                  {
                          _activityJobId = value;
                  }
              }
              private int _activityJobId;
        
              public string ActivityDescription {get;set;}
    }

    Thx Bela

    Friday, December 20, 2013 2:26 PM

All replies

  • LightSwitch has built-in support for SQL Server and SharePoint data sources. To access other data sources, you can write a custom WCF RIA DomainService. This post will show you how to read and write from an Odata Service by wrapping access to it in a DomainService.
    Tuesday, December 24, 2013 10:01 AM