Telerik Forums
UI for Silverlight Forum
4 answers
63 views
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.
Yoan
Telerik team
 answered on 01 Jun 2018
4 answers
179 views

We use RadDomainDataSource in our Silverlight project. After 1 year idle we get back to the project and found that it doesn't compile. The error message is:

Could not load file or assembly 'OpenRiaServices.DomainServices.Client, Version=2.0.5.0, Culture=neutral, PublicKeyToken=2e0b7ccb1ae5b4c8' or one of its dependencies. The system cannot find the file specified.

The project uses Telerik.Windows.Controls.DomainServices.OpenRia.dll which in turn refers to OpenRiaServices.DomainServices.Client version 2.0.5.0, but there is no such library in either location on PC.

We upgraded the project to the latest "UI for Silverlight R1 2017" but with no luck - it still requires 2.0.5.0 version of OpenRiaServices.DomainServices.Client.

The XAML pattern that causes the error is:

<telerik:RadDomainDataSource x:Name="qryER" AutoLoad="False" QueryName="GetExamRequestOne" LoadedData="qryER_LoadedData">
    <telerik:RadDomainDataSource.DomainContext>
        <e:MCMEDDomainContext />
    </telerik:RadDomainDataSource.DomainContext>
    <telerik:RadDomainDataSource.QueryParameters>
        <telerik:QueryParameter ParameterName="examReqID" />
    </telerik:RadDomainDataSource.QueryParameters>
</telerik:RadDomainDataSource>

 

Could you give us this library or tell where we can download them?

Yoan
Telerik team
 answered on 01 Jun 2018
2 answers
59 views

Hi.

I can build my Silverlight project using OpenRiaServices.Client.Core v4.4.0.3 and Telerik UI for Silverlight 5 2014.3.1326.

However, if I upgrade the OpenRiaServices.Client.Core NuGet packages to v4.5.0+, then I get the following build error:

"C:\MyProject\MyView.xaml : error : Cannot resolve reference assemblies. Please check the reference assemblies. Could not load file or assembly 'OpenRiaServices.DomainServices.Client, Version=2.0.5.0, Culture=neutral, PublicKeyToken=2e0b7ccb1ae5b4c8' or one of its dependencies. The system cannot find the file specified."

 

This is because the new OpenRiaServices.Client.Core v4.5 NuGet packages reference OpenRiaServices.DomainServices.Client, Version=4.0.0.0, but "Telerik.Windows.Controls.DomainServices.OpenRia.dll" references OpenRiaServices.DomainServices.Client, Version=2.0.5.0.

 

Is it possible to provide an updated "Telerik.Windows.Controls.DomainServices.OpenRia.dll" which references OpenRiaServices.DomainServices.Client, Version=4.0.0.0?

 

Thank you.

Yoan
Telerik team
 answered on 01 Jun 2018
7 answers
97 views
Greetings, I was just curious to see if there were any plans in the future to offer DomainDataSource support for the OpenRiaServices project. The OpenRiaServices project is the extension of the original RIA services code base that was open sourced from Microsoft to Colin Blair.

www.openriaservices.net/
Ivan Ivanov
Telerik team
 answered on 26 Dec 2016
5 answers
39 views

I have a DataForm and a GridView binding to two different DomainDataSources(use same DomainContext).

The DataForm.CurrentItem's navigation property able to modify from GridView.SelectedItem.

The first load GridView is fine,when I reload,the GridView's DomainDataSource didn't load(same query).

Even LoadingData not raised, so set e.LoadBehavior = LoadBehavior.RefreshCurrent is invalid.

Maya
Telerik team
 answered on 11 May 2016
7 answers
110 views
Hi.

I have read up on your documentation and examples but I cannot get the query value to bind to a value within the datacontext. When I try the query the parameter value is not correct. The two paramters are GUID's however it passes a blank GUID as the personguid

<Grid.Resources>
         <telerik:RadDomainDataSource x:Key="ddsEntitlements"
                                      AutoLoad="True"
                                      QueryName="GetAllowancesForPersonAndType"
                                      
                                     >
             <telerik:RadDomainDataSource.QueryParameters>
                 <telerik:QueryParameter ParameterName="personguid" Value="{Binding personguid}" />
                 <telerik:QueryParameter ParameterName="absencetype" Value="d859e02e-eaec-402e-ba21-6ebff3e66240"  />
 
             </telerik:RadDomainDataSource.QueryParameters>
             <telerik:RadDomainDataSource.DomainContext>
                 <e:AppDomainContext />
             </telerik:RadDomainDataSource.DomainContext>
         </telerik:RadDomainDataSource>
     </Grid.Resources>

WHERE ([Extent1].[person] = @p__linq__0) AND ([Extent2].[absencetype] = @p__linq__1)',N'@p__linq__0 uniqueidentifier,@p__linq__1 uniqueidentifier',@p__linq__0='0156C084-9DD9-4301-95D0-9E8EFE3ECCC7',@p__linq__1='00000000-0000-0000-0000-000000000000'
Maya
Telerik team
 answered on 08 Oct 2015
4 answers
44 views
I am trying to remove entities from QDSCV.

Currently I use  QDSCV.RemoveAt(index) method.
When I remove entity loaded from server - it work as expected.
But when I trying to remove newly added item (QDSCV.AddNew() and then QDSCV.RemoveAt()) then exception raised:
"The specified entity is not contained in this EntitySet"

What is the right way to remove newly added items from QDSCV?

(v.Q1-2013)
Anton
Top achievements
Rank 1
 answered on 27 Nov 2014
1 answer
48 views
In my project am adding new entity to QDSCV by AddNew(entity).
This always add new entity to the end of QDSCV collection.
Is it possible to insert new item at 0-index (as first collection element) or at any other desired position?
Dimitrina
Telerik team
 answered on 25 Nov 2014
2 answers
28 views
We are using QDSCV for entity collection display in RadGridView.

Collection item editing performed within separate DomainContext (let`s call it "contextEdit").

When edited entity updated in DB by contextEdit, then I need to refresh same entity  in QDSCV .

I am looking for best way to refresh Item in QDSCV so the RadGridView reflect this changes.

For now I am using my own deep copy procedure to assign QDSCV entity property values from the corresponding contextEdit` entity. Also using QDSCV.EditItem/CommitEdit:

qdscv.EditItem(currItem);
currItem.AssignFrom(newItem);
qdscv.CommitEdit();

This works fine during first call (QDSCV entity updated and RadGridView displayed changes).
But when I edit the same entity second time, the QDSCV entity updated, however RadGridView did not reflect any new changes.
Is it a bug in EditItem/CommitEdit methods or I have missed something?

Whether it`s another way to update QDSCV items so it is reflected in RadGridView?


Dimitrina
Telerik team
 answered on 24 Nov 2014
5 answers
183 views
Hi,

my problem is that when I am trying to delete an entity from an EntityCollection within the QDSCV and after that call the QDSCV.SubmitChanges method I am always getting an "Submit Error Not Handled"-Error. If I handle the error (e.MarkErrorAsHandled) the item is not removed. 

For expamle:

I have a Person that can have many Orders.
If my QDSCV is from type Person there will be an EntityCollection in it from type Order. If now remove a selected order from that collection I will get this error:

public void RemoveOrderFromPeople(Order order)
{
                foreach (Person person in People.Where(p => p.Orders.Contains(order)))
                {
                    person.Orders.Remove(order);
                }
 
                People.SubmitChanges();
}

How can I remove that entity from the collection, without getting this error but the item deleted from the db?


Thanks in advance!

Best wishes,
Julian


Nick
Telerik team
 answered on 23 Jun 2014
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?