Silverlight RIA: Extended entity class not working

Posts   
 
    
ABOH
User
Posts: 148
Joined: 06-Sep-2011
# Posted on: 26-Nov-2011 08:03:26   

Hello,

We have a Silverlight RIA application that is using LLBLGen for its DAL. LLBLGen generated a "CustomerEntity" in your .DAL filder. I want to add a constructor that contains all of the database required fields when creating a Customer, so I extended your class in a file in your EntityClasses folder. The code compiled, so I changed my code in the Silverlight client to use my constructor, and it reports that there isn't a constructor available that has five fields. In fact, IntelliSense only shows your constructor. Can you please advise how I can make my constructor appear in the Silverlight client using your DAL? Is there a switch in LLBLGen that will automatically create a constructor with database required fields? If not, it would be a great feature to add.

Thank you,

Mike

public partial class CustomerEntity
{
    /// <summary>
    /// Constructor with all required fields.
    /// </summary>
    /// <param name="theAccountId">FK value for the account
    /// associated with this Customer.</param>
    /// <param name="theCustomerLabel">Unique label for this Customer.</param>
    /// <param name="notifyByEmail">Indicate whether or not the
    /// Customer wants to be notified by email of expirations.</param>
    /// <param name="notifyByMail">Indicate whether or not the
    /// Customer wants to be notified by mail of expirations.</param>
    /// <param name="notifyByTelephone">Indicate whether or not the
    /// Customer wants to be notified by telephone of expirations.</param>
    /// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
    public CustomerEntity(
    Decimal theAccountId,
    string theCustomerLabel,
    bool notifyByEmail,
    bool notifyByMail,
    bool notifyByTelephone)
    {           
        this.InitClassEmpty(null, null);
        this.AccountId = theAccountId;
        this.CustomerLabel = theCustomerLabel;
        this.NotifyByEmail = notifyByEmail;
        this.NotifyByMail = notifyByMail;
        this.NotifyByTelephone = notifyByTelephone;
    }
}
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Nov-2011 18:44:42   

As far as I know, there is no System.ServiceModel.DomainServices.Server attribute you can use to send a custom constructor to the client. That means LLBLGen can't do much about that. What you can do is write your own entity factory at your DomainService, but I don't see this a real problem.

David Elizondo | LLBLGen Support Team
ABOH
User
Posts: 148
Joined: 06-Sep-2011
# Posted on: 28-Nov-2011 02:00:45   

Hi Daelmo,

Ahhhh... I see... Thank you for your help and suggestion!

Mike