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