Version: DataObjects.Net v.4.3.5 build 6015.

As i found that issue 785 is fixed, i am trying to use such feature. I have this model (not showed all):

[Serializable]
public class RefHolder<T> : Structure
{
    public T Ref { get; set; }
}

[HierarchyRoot(InheritanceSchema.SingleTable)]
[TableMapping("tDocuments")]
public abstract class Document<TOwner>: EntityBase where TOwner: Entity
{
    [Field]
    [TypeDiscriminator]
    public DocumentOwner OwnerType { get; set; }

    [Field]
    public RefHolder<TOwner> OwnerRef { get; set; }
}

[TypeDiscriminatorValue(DocumentOwner.Project, Default = true)]
public class ProjectDocument: Document<Project>
{...}

[TypeDiscriminatorValue(DocumentOwner.ReleaseSnapshot, Default = false)]
public class ReleaseSnapshotDocument : Document<ReleaseSnapshot>
{...}

But i get exception:

Xtensive.Storage.DomainBuilderException : Type 'Releases.Console.Model.RefHolder<Releases.Console.Model.Configuration>' is not registered in the model.
at Xtensive.Storage.Building.ModelInspector.GetTypeDef(Type type)
at Xtensive.Storage.Building.ModelInspector.InspectField(TypeDef typeDef, FieldDef fieldDef, Boolean isKeyField)
at Xtensive.Storage.Building.ModelInspector.Inspect(TypeDef typeDef)
at Xtensive.Storage.Building.Builders.ModelBuilder.InspectAndProcessGeneratedEntities(BuildingContext context)
at Xtensive.Storage.Building.Builders.ModelBuilder.Run()
at Xtensive.Storage.Building.Builders.DomainBuilder.BuildModel()
at Xtensive.Storage.Building.Builders.DomainBuilder.BuildDomain(DomainConfiguration configuration, DomainBuilderConfiguration builderConfiguration)
at Xtensive.Storage.Upgrade.UpgradingDomainBuilder.BuildStageDomain(UpgradeStage stage)
at Xtensive.Storage.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration)
at Model.Test.AutoBuildTest.BuildDomain(DomainConfiguration configuration) in AutoBuildTest.cs: line 47
at Model.Test.AutoBuildTest.TestFixtureSetUp() in AutoBuildTest.cs: line 21

That for me it seems bug is still there (maybe another way to show up that bug).

asked Sep 16 '10 at 03:41

Peter%20%C5%A0ulek's gravatar image

Peter Šulek
492313236

edited Sep 16 '10 at 03:50

strange is that it looks for entity type Releases.Console.Model.Configuration within RefHolder but there is no entity which will has property of type RefHolder<configuration>

(Sep 16 '10 at 05:14) Peter Šulek Peter%20%C5%A0ulek's gravatar image

When i manually add type as: configuration.Types.Register(typeof (RefHolder<configuration>)); then it looks for another type from my model.

(Sep 16 '10 at 05:18) Peter Šulek Peter%20%C5%A0ulek's gravatar image

One Answer:

I've reopened the issue.

To be fixed.

BTW, thanks for the updated model. This will definitely simplify the testing/fixing process.

answered Sep 16 '10 at 03:49

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

edited Sep 16 '10 at 03:50

The issue is fixed (yeah, again).

(Sep 22 '10 at 03:32) Dmitri Maximov Dmitri%20Maximov's gravatar image

When i can test this fix, in which build number ?

(Sep 22 '10 at 07:13) Peter Šulek Peter%20%C5%A0ulek's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA