Continued refactoring of Db class

This commit is contained in:
Rick Falkvinge
2018-12-31 05:44:56 +01:00
parent 93f96d5f22
commit ac72f6bdf0
4 changed files with 49 additions and 1 deletions
+10
View File
@@ -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) ";
*/
}
}
+1 -1
View File
@@ -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)
+24
View File
@@ -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; }
}
}
+14
View File
@@ -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() { }
}
}