Click here to Skip to main content
11,702,130 members (61,576 online)
Rate this: bad
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;

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()

public void LoadClients(bool UploadThisTableOnly)
LoadOperation loadOpClient = toContext.Load(toContext.GetClientsQuery(),LoadBehavior.RefreshCurrent, false);



4.- These are the warning and error I get:

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’.

“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 14:25pm

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

  Print Answers RSS
0 Maciej Los 395
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 314
3 CHill60 145
4 Mika Wendelius 119
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,507
2 CPallini 4,922
3 Maciej Los 4,371
4 Mika Wendelius 3,556

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 5 Jul 2013
Copyright © CodeProject, 1999-2015
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