Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi All,
 
Calculated properties work fine when the WCF RIA Services are created under the web page that hosts the Silverlight application. However, I cannot figure out why computed properties do not work with WCF RIA Services Class Library (everything else works fine with WCF RIA Services Class Library).
 
Please provide advice to solve this issue. I greatly appreciate your advice.
 
Thanks in advance,

Luis Nambiar
 

A small example of what I have is shown below.
 
1.- This is the metadata generated in the WCF RIA Services Class Library called ‘ClientsSetUpRiaLib’:
 
namespace ClientsSetUpRiaLib.Web
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
 

[MetadataTypeAttribute(typeof(ClientContact.ClientContactMetadata))]
public partial class ClientContact
{
internal sealed class ClientContactMetadata
{
private ClientContactMetadata()
{
}
public string LastName { get; set; }
public string PhoneNumber { get; set; }
}
}
}
2.- This is the calculated property in file ‘Class1.cs’
using System.ServiceModel.DomainServices.Client;
 
namespace ClientsSetUpRiaLib.Web
{
public partial class Client : Entity
{
public int No { get; set; }
}
}
 
3.- This is the code in the MainPage.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using ClientsSetUpRiaLib.Web;
 
namespace SilverlightApplication2
{
public partial class MainPage : UserControl
{
public AdminDomain toContext = new AdminDomain();
 
public MainPage()
{
InitializeComponent();
}
 
public void LoadClients(bool UploadThisTableOnly)
{
LoadOperation loadOpClient = toContext.Load(toContext.GetClientsQuery(),LoadBehavior.RefreshCurrent, false);

}
 
}
}
 
4.- These are the warning and error I get:
 
WARNING:
The type ‘ClientsSetUpRiaLib.Web.Client’ in ‘c:\BegASPNET\ezto\SilverlightApplication2\Class1.cs’ conflicts with the imported type ‘ClientsSetUpRiaLib.Web.Client’ in ‘c:\BegASPNET\ezto\ClientsSetUpRiaLib\Bin\Debug\ClientsSetUpRiaLib.dll’. Using the type defined in ‘c:\BegASPNET\ezto\SilverlightApplication2\Class1.cs’.
 
ERROR:
“Cannot implicitly convert type ‘System.ServiceModel.DomainServices.Client.LoadOperation[c:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight\System.ServiceModel.DomainServices.Client.dll]’ to ‘System.ServiceModel.DomainServices.Client.LoadOperation[c:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight\System.ServiceModel.DomainServices.Client.dll]’
Posted 5-Jul-13 15:25pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 5 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100