I have read all the posts I can find on this error, but I still cannot see why I am getting this exception. I have a property which is a ECC. Here is my property declaration:
private static PropertyInfo<MailboxList> MailboxesProperty = This property is declared in a concrete class, derived directly from BusinessBase<T> : [Serializable] (IObjectMapper is just an empty interface through which I apply some extension methods for mapping to and from the data layer.) When I try to reference this property either directly or through ReadProperty, it throws an InvalidOperationException with the message: "One or more properties are not registered for this type." The MailboxList class is declared: [Serializable()] Can anyone see what I am missing here? My other (non-list) properties register just fine in this class - so what's wrong wth the one which is an ECC? Frazer
RegisterProperty(typeof(MailboxList), new PropertyInfo<MailboxList>("Mailboxes", "Mailboxes"));
public MailboxList Mailboxes
{
get
{
if (!FieldManager.FieldExists(MailboxesProperty))
LoadProperty(MailboxesProperty, MailboxList.NewMailboxList());
return GetProperty(MailboxesProperty);
}
set { SetProperty(MailboxesProperty, value); }
}
public class Employee : BusinessBase<Employee>, IObjectMapper
public class MailboxList : Csla.BusinessListBase<MailboxList, Mailbox>
The first argument of RegisterProperty is the type which OWNS the property... not the type the property will contain. The T in PropertyInfo<T> describes what type the property holds. Just remove that parameter completely, so your call is RegisterProperty(new PropertyInfo<MailboxList>("Mailboxes", "Mailboxes"));
Sheesh.
Thanks, Andy.
cheers,
Frazer
Hope I didn't come off as harsh or anything, because you're certainly not the first person to have some confusion around this. I appologize if I did.
Copyright (c) Marimer LLC