Hi,
I've encountered the following Problem while using your DataObjects.NET 4.3 for .NET 3.5:
I've got the following Situation:
There's a so called "StorageToDiscover", which looks like this:
[Serializable]
[HierarchyRoot]
public class CelerraToDiscover : Entity
{
[Field, Key]
public int ObjectID { get; private set; }
[Field]
public char Status { get; set; }
[Field]
public int AgentID { get; set; }
[Field(Length = 256)]
public string SystemName { get; set; }
[Field(Length = 64)]
public string PluginName { get; set; }
[Field(Length = 64)]
public string Username { get; set; }
[Field(Length = 512)]
public string Password { get; set; }
[Field(Length = 15)]
public string StorageIP { get; set; }
public int CustomerID { get; set; }
//public List<StorageCelerraDisk> Disks { get; set; }
//public List<StorageCelerraPool> Pools { get; set; }
//public List<StorageCelerraFilesystems> Filesystems { get; set; }
public CelerraToDiscover(int objectID)
: base(objectID)
{ }
Which is created by a Web-Frontend into the Database, Querying this Object works without any problems, eg. like this:
var bla2 = Query.All<CelerraToDiscover>();
The Backend loads this Entity, works with it and saves it as DiscoveredStorage into the Database, with the SAME ObjectID as the StorageToDiscover (which is intended).
The DiscoveredStorage Entity looks like this:
[Serializable]
[HierarchyRoot]
public class StorageCelerra : Entity
{
[Field, Key]
public int ObjectID { get; private set; }
[Field]
public char Status { get; set; }
[Field(Length = 128)]
public string StorageStatus { get; set; }
[Field(Length = 256)]
public string Type { get; set; }
[Field(Length = 256)]
public string SerialNumber { get; set; }
[Field(Length = 256)]
public string Version { get; set; }
[Field(Length = 256)]
public string Host { get; set; }
[Field(Length = 256)]
public string Name { get; set; }
public StorageCelerra(int objectID)
: base(objectID)
{
}
}
After this Instance is saved, I want to upadte it's properties. Therefore I Query it from the Database like this:
var bla = Query.All<StorageCelerra>();
Which leads to this Error:
Exception:
{"Invalid TupleDescriptor. Expected descriptor is TupleDescriptor(Int32, Int32, Char, Int32, String, String, String, String, String).\r\nParameter name: difference"}System.SystemException {System.ArgumentException}
StackTrace:
at Xtensive.Core.Tuples.TupleExtensions.MergeWith(Tuple origin, Tuple difference, Int32 startIndex, Int32 length, MergeBehavior behavior)
at Xtensive.Core.Tuples.TupleExtensions.MergeWith(Tuple origin, Tuple difference, MergeBehavior behavior)
at Xtensive.Storage.EntityState.Update(Tuple update)
at Xtensive.Storage.Session.UpdateEntityState(Key key, Tuple tuple, Boolean isStale)
at Xtensive.Storage.Session.UpdateEntityState(Key key, Tuple tuple)
at Xtensive.Storage.Providers.SessionHandler.UpdateEntityStateInSessionCache(Key key, Tuple tuple, Boolean isStale)
at Xtensive.Storage.Providers.SessionHandler.RegisterEntityState(Key key, Tuple tuple)
at Xtensive.Storage.Linq.Materialization.ItemMaterializationContext.Materialize(Int32 entityIndex, Int32 typeIdIndex, TypeInfo type, Pair`1[] entityColumns, Tuple tuple)
at lambda_method(Closure , Object[] , Tuple , ItemMaterializationContext )
at Xtensive.Core.DelegateBindExtensions.<>c__DisplayClassa`4.<Bind>b__9(T2 arg2, T3 arg3)
at Xtensive.Storage.Linq.Materialization.MaterializationHelper.<>c__DisplayClass4`1.<Materialize>b__3(Tuple tuple)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Xtensive.Core.EnumerableExtensions.<Batch>d__27`1.MoveNext()
at Xtensive.Core.EnumerableExtensions.<ApplyBeforeAndAfter>d__2f`1.MoveNext()
at Xtensive.Storage.TransactionalExtensions.<ToTransactional>d__0`1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Linq.SystemCore_EnumerableDebugView`1.get_Items()"
But, I can see the Item in the Database:

Why can't I query it?
I hope the description of my problem was understandable, thanks in advance & greetings
Simon