I have a business object property of type System.Xml.Linq.XElement:
//HouseholdDemographicsXML Property
private static PropertyInfo<XElement> HouseholdDemographicsXMLProperty =
RegisterProperty(typeof(Household),
new PropertyInfo<XElement>("HouseholdDemographicsXML", "Household Demographics XML"));
public XElement HouseholdDemographicsXML
{
get { return GetProperty(HouseholdDemographicsXMLProperty); }
set { SetProperty(HouseholdDemographicsXMLProperty, value); }
}
When I try and set the value
LoadProperty(HouseholdDemographicsXML, XElement.Parse(data.Demographics));
where data.Demographics is a string representing an XML fragment, I get the errors
The best overloaded method match for Csla.Core.BusinessBase.LoadProperty<System.Xml.Linq.XElement>(Csla.PropertyInfo<System.Xml.Linq.XElement>, System.Xml.Linq.XElement)' has some invalid arguments
and
Argument 1: cannot convert from 'System.Xml.Linq.XElement' to 'Csla.PropertyInfo<System.Xml.Linq.XElement>'
What am I doing wrong? Can’t a business object property be an XElement?
I think you need to change this:
LoadProperty(HouseholdDemographicsXML, XElement.Parse(data.Demographics));
to this:
LoadProperty(HouseholdDemographicsXMLProperty, XElement.Parse(data.Demographics));
Copyright (c) Marimer LLC