This is a migrated thread and some comments may be shown as answers.

QueryableDomainServiceCollectionView is not recognizing a POCO as entity

4 Answers 85 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 22 Mar 2016, 04:11 AM
We have Silverlight MVVM project. Recently migrated to EF6 and openRiaServices. I'm getting below error

'Error1 The type 'TestDataPOCO.Sovereign' cannot be used as type parameter 'TEntity' in the generic type or method 'Telerik.Windows.Data.QueryableDomainServiceCollectionView<TEntity>'. There is no implicit reference conversion from 'TestDataPOCO.Sovereign' to 'OpenRiaServices.DomainServices.Client.Entity'.C:\Users\deepu\Documents\Visual Studio 2013\Projects\Demo\App.Silverlight\MainPage.xaml.cs2664

Error2 The type 'OpenRiaServices.DomainServices.Client.Entity' is defined in an assembly that is not referenced. You must add a reference to assembly 'OpenRiaServices.DomainServices.Client, Version=2.0.5.0, Culture=neutral, PublicKeyToken=2e0b7ccb1ae5b4c8'.C:\Users\deepu\Documents\Visual Studio 2013\Projects\Demo\App.Silverlight\MainPage.xaml.cs2664



I have reference to 'OpenRiaServices.DomainServices.Client.Entity'.

Below is the serverside code...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using OpenRiaServices.DomainServices.Hosting;
using OpenRiaServices.DomainServices.Server;

namespace TestDataPOCO
{
    [EnableClientAccessAttribute]
    public class SovereignDomainSevice : DomainService
    {
        [Query]
        public IEnumerable<Sovereign> GetSovereigns()
        {
            Sovereign sovereign = new Sovereign();
            return sovereign.FetchSovereigns();
        }

        [Invoke]
        public IQueryable<Sovereign> GetSovereign()
        {
            Sovereign sovereign = new Sovereign();
            return sovereign.FetchSovereigns().AsQueryable<Sovereign>();
        }

       
        [Update()]
        public void UpdateSovereign(Sovereign sovereign)
        {
            throw new NotImplementedException();
        }

    }

    public class Sovereign
    {
        [Key]
        public int UniqueId { get; set; }
        public string Name { get; set; }
        public string House { get; set; }
        public string Dominion { get; set; }
        public int ReignStart { get; set; }
        public int ReignEnd { get; set; }
        public string Sobriquet { get; set; }

        public List<Sovereign> FetchSovereigns()
        {

            List<Sovereign> sovereignList = new List<Sovereign>
            {
            new Sovereign()
                {UniqueId = 1, 
                 Name = "John", 
                 House = "Plantagenet", 
                 Dominion = "Angevin Empire", 
                 ReignStart = 1167, 
                 ReignEnd = 1216, 
                 Sobriquet = "Lackland"
                },
            new Sovereign()
                {UniqueId = 2, 
                 Name = "Charles", 
                 House = "Stuart", 
                 Dominion = "England, Scotland, & Ireland", 
                 ReignStart = 1625, 
                 ReignEnd = 1649, 
                 Sobriquet = "The Martyr"
                },
            new Sovereign()
                {UniqueId = 3, 
                 Name = "William", 
                 House = "Dunkeld", 
                 Dominion = "Scotland", 
                 ReignStart = 1165, 
                 ReignEnd = 1249, 
                 Sobriquet = "The Lion"
                },   
            new Sovereign()
                {UniqueId = 4, 
                 Name = "Elizabeth", 
                 House = "Tudor", 
                 Dominion = "England", 
                 ReignStart = 1555, 
                 ReignEnd = 1609, 
                 Sobriquet = "The Virgin Queen"
                },
            new Sovereign()
                {UniqueId = 5, 
                 Name = "Ivan", 
                 House = "Vasilyevich", 
                 Dominion = "Russia", 
                 ReignStart = 1533, 
                 ReignEnd = 1584, 
                 Sobriquet = "The Terrible"
                },
            new Sovereign()
                {UniqueId = 6, 
                 Name = "Charles1", 
                 House = "Valois", 
                 Dominion = "France", 
                 ReignStart = 1380, 
                 ReignEnd = 1422, 
                 Sobriquet = "The Mad"
                },
            new Sovereign()
                {UniqueId = 7, 
                 Name = "Charles2", 
                 House = "Valois", 
                 Dominion = "France", 
                 ReignStart = 1380, 
                 ReignEnd = 1422, 
                 Sobriquet = "The Mad"
                },
            new Sovereign()
                {UniqueId = 8, 
                 Name = "Charles3", 
                 House = "Valois", 
                 Dominion = "France", 
                 ReignStart = 1380, 
                 ReignEnd = 1422, 
                 Sobriquet = "The Mad"
                },
            new Sovereign()
                {UniqueId = 9, 
                 Name = "Charles4", 
                 House = "Valois", 
                 Dominion = "France", 
                 ReignStart = 1380, 
                 ReignEnd = 1422, 
                 Sobriquet = "The Mad"
                },
            new Sovereign()
                {UniqueId = 10, 
                 Name = "Charles5", 
                 House = "Valois", 
                 Dominion = "France", 
                 ReignStart = 1380, 
                 ReignEnd = 1422, 
                 Sobriquet = "The Mad"
                }

            };
            return sovereignList;
        }
    }
}


Not sure why QDSCV is not recognizing 'Sovereign' as an entity. 
I looked at Generated_Code, it is showing 'Sovereign' POCO being inherted from OpenRiaServices.DomainServices.Client.Entity.

Thanks for the help in advance.

4 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 23 Mar 2016, 11:27 AM
Hello,

May I ask you to confirm that you do not have a problem if you are not using our QueryableDomainServiceCollectionView? In this way, you will verify that you had migrated successfully to OpenRIA. If you the same problem without our control, then I can suggest you check this blog post for a reference.

Please note that you need to use the signed version of OpenRia when you are using our Telerik.Windows.Controls.DomainServices.OpenRia .

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Missing User
answered on 23 Mar 2016, 03:46 PM

Hi,

 

Yes everything else is working except QDSCV.. I do not have signed version of openRia. Let me try with that.

Thanks for your help.

 

Regards,

Deepthi Deme

0
Yoan
Telerik team
answered on 24 Mar 2016, 08:07 AM
Hello,

I believe that this is the cause of the problem since our is built on top of the signed version of OpenRIA. However, let me know about the result.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Yoan
Telerik team
answered on 01 Jun 2018, 08:35 AM
Hello,

As a quick follow up :

It seems that the error you get comes from the fact that you had updated the OperRiaServices which produces the 'OpenRiaServices.DomainServices.Client  with version 4.0.0.0. Our Telerik.Windows.Controls.DomainServices.OpenRia  is built against the old version of OpenRiaServices.DomainServices.Client - version 2.0.5.0. Recently, there was a demand to update our OpenRia library so it is compatible with the latest version of OpenRiaServices. We will include a new Telerik.Windows.Controls.DomainServices.OpenRia45.dll in some of our next internal builds. I had logged a public item regarding this feature in our feedback portal - https://feedback.telerik.com/Project/143/Feedback/Details/250790-domaindatasource-add-support-for-the-latest-version-of-openriaservices-version. You can subscribe to it in order to get updates regarding its status.

Regards,
Yoan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DomainDataSource
Asked by
Missing User
Answers by
Yoan
Telerik team
Missing User
Share this question
or