Composition and RIA
i have problems with related properties Composition attribut and RIA.I 'm using POCO and silverlight. here is my modele :
[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]
开发者_StackOverflow [Composition]
public ModeleEnvoiEaHeaderFooter ModeleEnvoiEaFooter;
}
}
In client side i call Test domaine service method , in the client side the property ModeleEnvoiEaFooter is not null, but in my DomainServices class this property is null. Even with de Composition attribut. How can i send the value of ModeleEnvoiEaFooter property to Domainservices class ?
[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
}
Try marking ModeleEnvoiEaFooter as a DataMember.
精彩评论