This commit is contained in:
@@ -61,7 +61,10 @@ namespace AyaNova.Biz
|
||||
TODO: going to need some SQL hints added here
|
||||
- SqlIDColumn indicating what the ID column is to fetch the underlying value from
|
||||
- SqlColumn indicating an alternative column name as known to the sql server if it varies from the propertyname (in lowercase)
|
||||
|
||||
Also: going to need a definition of the table name and the default identity column
|
||||
Maybe decorate with an INTERNAL ONLY bool so that we see it at the server but not at the client or when fetched as possible fields
|
||||
|
||||
hypothetical to help develop this:
|
||||
Client and head office list:
|
||||
{key=ClientName, propertyname=Name, idcolumn=id,}
|
||||
@@ -272,7 +275,7 @@ namespace AyaNova.Biz
|
||||
sb.Append($",\"ay\":{(int)o.AyObjectType}");
|
||||
|
||||
sb.Append("}");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
sb.Append("]");
|
||||
@@ -301,6 +304,11 @@ namespace AyaNova.Biz
|
||||
//then the type to open is set here
|
||||
public int AyObjectType { get; set; }
|
||||
|
||||
//For query building
|
||||
//This is the equivalent of the v7 SqlColumnNameAttribute
|
||||
public string SqlIdColumn { get; set; }
|
||||
public string SqlColumn { get; set; }
|
||||
|
||||
|
||||
public ObjectField()
|
||||
{
|
||||
@@ -313,6 +321,31 @@ namespace AyaNova.Biz
|
||||
MiniAvailable = true;
|
||||
//Set openable object type to no type which is the default and means it's not a link to another object
|
||||
AyObjectType = (int)AyaType.NoType;
|
||||
|
||||
}
|
||||
|
||||
public string GetSqlColumnName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(SqlColumn))
|
||||
{
|
||||
return PropertyName.ToLowerInvariant();
|
||||
}
|
||||
else
|
||||
{
|
||||
return SqlColumn;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetSqlIdColumnName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(SqlIdColumn))
|
||||
{
|
||||
return "id";
|
||||
}
|
||||
else
|
||||
{
|
||||
return SqlIdColumn;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user