组成和RIA

时间:2011-03-16 10:30:02

标签: entity-framework silverlight-4.0 ria wcf-ria-services

我遇到相关属性问题组成attribut和RIA.I使用POCO和silverlight。这是我的模式:

[MetadataTypeAttribute(typeof(ModeleEnvoiEaMetaData))]
    [Serializable]
    public abstract partial class ModeleEnvoiEa
    { 
        [DataMember]
        public virtual int IdModeleEnvoiEa {get;set;}
        [DataMember]
        public virtual string Libelle {get;set;}
        [DataMember]
        public virtual Nullable<int> IdModeleEnvoiEaFooter  {...//FK }
        public virtual ModeleEnvoiEaHeaderFooter ModeleEnvoiEaFooter
        {
            get { return _modeleEnvoiEaFooter; }
            set
            {
                if (!ReferenceEquals(_modeleEnvoiEaFooter, value))
                {
                    var previousValue = _modeleEnvoiEaFooter;
                    _modeleEnvoiEaFooter = value;
                    FixupModeleEnvoiEaFooter(previousValue);
                }
            }
        }
        private ModeleEnvoiEaHeaderFooter _modeleEnvoiEaFooter;
     }

public partial class ModeleEnvoiEaMetaData
    {
//...
[Association("ModeleEnvoiEa_ModeleEnvoiEaFooter","IdModeleEnvoiEaFooter","IdModeleEnvoiEaHeaderFooter")]
        [Include]
        [Composition]
        public ModeleEnvoiEaHeaderFooter ModeleEnvoiEaFooter;    
}

}

在客户端我调用Test domaine服务方法,在客户端,属性ModeleEnvoiEaFooter不为null,但在我的DomainServices类中,此属性为null。即使是de Composition attribut。如何将ModeleEnvoiEaFooter属性的值发送到Domainservices类?

 [Invoke]
 public ModeleEnvoiEa Test(ModeleEnvoiEa modele)
 {
  // modele.IdModeleEnvoiEaFooter   == 1 // FK to ModeleEnvoiEaFooter 
  // modele.ModeleEnvoiEaFooter is null here ! Why ? an how can i send this object 
 }

1 个答案:

答案 0 :(得分:0)

尝试将ModeleEnvoiEaFooter标记为DataMember。