Continued refactoring of Db class
This commit is contained in:
@@ -47,5 +47,15 @@ namespace Swarmops.Basic
|
||||
// every class that derives from DbColumnAwareBase
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* sample SELECT sequence:
|
||||
* private const string financialAccountDocumentFieldSequence =
|
||||
" FinancialAccountDocumentId,FinancialAccountId,FinancialAccountDocumentTypes.Name,UploadedDateTime,UploadedByPersonId, " + // 0-4
|
||||
" ConcernsPeriodStart,ConcernsPeriodEnd,RawDocumentText " + // 5-7
|
||||
" FROM FinancialAccountDocuments JOIN FinancialAccountDocumentTypes USING (FinancialAccountDocumentTypeId) ";
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Swarmops.Common.Attributes
|
||||
{
|
||||
public DbColumnName()
|
||||
{
|
||||
// means the column name is the same as the property name that houses the attribute
|
||||
// empty attr means the column name is the same as the property name that houses the attribute
|
||||
this.ColumnName = string.Empty;
|
||||
}
|
||||
public DbColumnName(string columnName)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Swarmops.Common.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class DbColumnForeignTypeName: Attribute
|
||||
{
|
||||
public DbColumnForeignTypeName(string foreignTableName, string commonIdColumnName, string foreignTypeColumnName)
|
||||
{
|
||||
this.ForeignTableName = foreignTableName;
|
||||
this.CommonIdColumnName = commonIdColumnName;
|
||||
this.ForeignTypeColumnName = foreignTypeColumnName;
|
||||
}
|
||||
|
||||
public string ForeignTableName { get; private set; }
|
||||
public string CommonIdColumnName { get; private set; }
|
||||
public string ForeignTypeColumnName { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Swarmops.Common.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class DbIdentity: Attribute
|
||||
{
|
||||
public DbIdentity() { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user