RIA Service - without database?
        Posted  
        
            by Heko
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Heko
        
        
        
        Published on 2010-03-15T15:12:06Z
        Indexed on 
            2010/05/18
            18:00 UTC
        
        
        Read the original article
        Hit count: 249
        
Helo!
I need to write a RIA service to call Java webservices from Silverlight 3.0 app. I'm testing how stuff works and in my Web app I have a MyData class which has 2 properties (int ID, string Text):
namespace SilverlightApplication1.Web
{
    public class MyData
    {
        [Key]
        public int ID { get; set; }
        public string Text { get; set; }
    }
}
Then I wrote simple DomainService:
[EnableClientAccess()]
public class MyService : DomainService
    {
        public IQueryable<MyData> GetMyData(string Url)
        {
                    // here I will call my WebService
            List<MyData> result = new List<MyData>();
            result.Add(new MyData { ID = 1, Text = Url });
            return result.AsQueryable();
        }
    }
}
How can I get data into my SL app? Now I have this:
namespace SilverlightApplication1 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); MyContext context = new MyContext(); } } }
I called and load but nothink worsk (exceptions, or nulls)...
I had Invoke annotation but MyData is not TEntity and I can't use Strings or other simple types as well... :/ I'm reading and reading posts and nothing works like it should..
Any help would be really appreciated.
Thank you!
© Stack Overflow or respective owner