1. The standard table naming convention for AC is "ac_PluralEntityName". Example: ac_OrderNotes
The templates provided do not seem to address converting plural table names to singular entity names (e.g. OrderNote). Are you manually handling this afterwards, just stripping the trailing "s" off, doing something more complex?
2. The generated code seems to only handle simple properties (int, bool, string, datetime). It does not seem to be taking foreign key retraints into account and wiring up the related AC objects.
Example:
custom_CustomerNotes (int CustomerNoteId, int CustomerId, int UserId, DateTime CreatedDate, nvarchar(MAX) Comment, tinyint NoteTypeId) with FKs for CustomerId and UserId
Are you manually handling this in custom partial classes? Using the example above, would I create a partial class for CustomerNote and manually add User properties for Customer and User?
Code: Select all
public partial class CustomerNote
{
protected User _Customer;
public User Customer
{
get
{
if ((this._Customer == null && this._CustomerId > 0) || (this._Customer != null && this._Customer.UserId != this._CustomerId))
{
_Customer = UsersDataSource.Load(this._CustomerId);
}
return _Customer;
}
set
{
this._Customer = value;
if (this._Customer != null)
{
this._CustomerId = this._Customer.UserId;
}
else
{
this._CustomerId = 0;
}
}
}
}