This question is locked. New answers and comments are not allowed.
I have two entities
RealEstate and Hierarchy. They are linked many to one (RealEstate 1 <-->
* Hierarchy).
RealEstate has navigation property "Hierarchies".
Hierarchy has navigation property "RealEstate".
As soon as my tables contain more than 1 million rows there is no possible to
set managed link.
Scenario 1: Add entities natively.
CoreModel context = new CoreModel();
var realEstate = new RealEstate { Title = "", RecordStatus =
RecordStatus.Active, Version = 1, RegistrationDate = DateTime.Now };
var hierarchy = new Hierarchy { HierarchyTypeId = 12 };
hierarchy.RealEstate = realEstate;
context.Add(realEstate);
context.SaveChanges();
OK. No errors.
Scenario 2. Add entities through WCF (5.6.1)
var realEstate = new RealEstate { Title = "", RecordStatus =
RecordStatus.Active, Version = 1, RegistrationDate = DateTime.Now };
context.AddToRealEstates(realEstate);
var hierarchy = new Hierarchy { ParentRealEstateId = null, HierarchyTypeId =
12, UniqueId = Guid.NewGuid(), CharacteristicTypeId = 21 };
context.AddToHierarchies(hierarchy);
context.SetLink(hierarchy, "RealEstate", realEstate);
context.SaveChanges();
Error:
<?xml version="1.0" encoding="utf-8"?><m:error
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code
/><m:message xml:lang="ru-RU">При обработке этого запроса
возникла ошибка.</m:message><m:innererror><m:message>No row
for FondRGS.RZU.Core.RealEstate ('entity_RealEstate') GenericOID@3d330985
RealEstate
Id=0</m:message><m:type>Telerik.OpenAccess.OpenAccessException</m:type>
With help of Fiddler, I see than passed entity has navigation property with new
generated realEstateId.
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RealEstate"
type="application/atom+xml;type=entry" title="RealEstate"
href="http://test/CoreService.svc/RealEstates(1545560L)"
xmlns="http://www.w3.org/2005/Atom" />
But ORM tries to use RealEstateId values instead of RealEstate (property). The
same works like a charm in EF 5.
RealEstate and Hierarchy. They are linked many to one (RealEstate 1 <-->
* Hierarchy).
RealEstate has navigation property "Hierarchies".
Hierarchy has navigation property "RealEstate".
As soon as my tables contain more than 1 million rows there is no possible to
set managed link.
Scenario 1: Add entities natively.
CoreModel context = new CoreModel();
var realEstate = new RealEstate { Title = "", RecordStatus =
RecordStatus.Active, Version = 1, RegistrationDate = DateTime.Now };
var hierarchy = new Hierarchy { HierarchyTypeId = 12 };
hierarchy.RealEstate = realEstate;
context.Add(realEstate);
context.SaveChanges();
OK. No errors.
Scenario 2. Add entities through WCF (5.6.1)
var realEstate = new RealEstate { Title = "", RecordStatus =
RecordStatus.Active, Version = 1, RegistrationDate = DateTime.Now };
context.AddToRealEstates(realEstate);
var hierarchy = new Hierarchy { ParentRealEstateId = null, HierarchyTypeId =
12, UniqueId = Guid.NewGuid(), CharacteristicTypeId = 21 };
context.AddToHierarchies(hierarchy);
context.SetLink(hierarchy, "RealEstate", realEstate);
context.SaveChanges();
Error:
<?xml version="1.0" encoding="utf-8"?><m:error
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code
/><m:message xml:lang="ru-RU">При обработке этого запроса
возникла ошибка.</m:message><m:innererror><m:message>No row
for FondRGS.RZU.Core.RealEstate ('entity_RealEstate') GenericOID@3d330985
RealEstate
Id=0</m:message><m:type>Telerik.OpenAccess.OpenAccessException</m:type>
With help of Fiddler, I see than passed entity has navigation property with new
generated realEstateId.
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RealEstate"
type="application/atom+xml;type=entry" title="RealEstate"
href="http://test/CoreService.svc/RealEstates(1545560L)"
xmlns="http://www.w3.org/2005/Atom" />
But ORM tries to use RealEstateId values instead of RealEstate (property). The
same works like a charm in EF 5.