public interface IEntityTyped
{
    [Association(OnTargetRemove = OnRemoveAction.Cascade)]
    [Field(Nullable = false)]
    string ItemType { get; set; }
}

[Serializable]
[HierarchyRoot]
public class FakeEntity : Entity, IEntityTyped
{
    [Field]
    public string Idqwe { get; private set; }

    [Association(OnTargetRemove = OnRemoveAction.Default)]
    public string ItemType { get; set; }
}

Just create this setup, it will fail during compile-time

asked Dec 13 '10 at 04:27

xumix's gravatar image

xumix
425757682

edited Jan 04 '11 at 16:01

Sergey's gravatar image

Sergey
123339

Shouldn't your interface inherit from IEntity?

(Dec 17 '10 at 04:22) ara ara's gravatar image

It definitely must inherit IEntity.

I suppose, this code snippet was just a quick and dirty extraction from the domain model (notice the absence of Key attribute on Idwefield, Association attribute on string field, etc.)

(Dec 17 '10 at 04:26) Dmitri Maximov Dmitri%20Maximov's gravatar image

2 Answers:

Hello,

Compile-time check for interface associations has been removed completely. More thorough integrity check of associations will be performed during building of the domain.

answered Dec 13 '10 at 07:26

Alexis%20Kochetov's gravatar image

Alexis Kochetov
1414

edited Dec 13 '10 at 07:26

Hello xumix,

Thanks, to be done.

answered Dec 13 '10 at 06:38

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

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