Skip to content

Commit

Permalink
Merge branch 'feature'
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgios (Yiorgos) Trifidis committed Oct 26, 2018
2 parents 2df07e0 + af94f33 commit bca9dbd
Show file tree
Hide file tree
Showing 168 changed files with 4,133 additions and 2,808 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ OrpheusSQLiteDDLHelper/OrpheusSQLiteDDLHelper.cs
OrpheusSQLiteDDLHelper/OrpheusSQLiteDDLHelper.csproj
OrpheusTests/OrpheusSQLiteServerConfig.json
*.user
Nuget/PublishPackage.cmd.bak
Nuget/CreatePackage.cmd.bak
.vs/Orpheus.NetCore/v15/Server/sqlite3/storage.ide-wal
.vs/Orpheus.NetCore/v15/Server/sqlite3/storage.ide-shm
.vs/Orpheus.NetCore/DesignTimeBuild/.dtbcache
.vs/Orpheus.NetCore/v15/Server/sqlite3/db.lock
*.bak
/.vs/Orpheus.NetCore/v15/Server/sqlite3/storage.ide-wal
/.vs/Orpheus.NetCore/v15/Server/sqlite3/storage.ide-shm
/.vs/Orpheus.NetCore/v15/Server/sqlite3/db.lock
/.vs/Orpheus.NetCore/DesignTimeBuild/.dtbcache
3 changes: 3 additions & 0 deletions Nuget/CreatePackage.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@echo building solution
"%programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" ..\Orpheus.NetCore.sln /t:Clean,Build /p:Configuration=Release

mkdir 2.0.0\lib\netstandard2.0
@echo Nuget folder created.
xcopy ..\OrpheusAttributes\bin\release\netcoreapp2.0\OrpheusAttributes.dll 2.0.0\lib\netstandard2.0 /Y /Q
Expand Down
2 changes: 1 addition & 1 deletion Nuget/OrpheusORM.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>OrpheusORM</id>
<version>1.1.3</version>
<version>1.1.4</version>
<title>OrpheusORM</title>
<authors>Trifidis Georgios(Yiorgos)</authors>
<owners>Trifidis Georgios(Yiorgos)</owners>
Expand Down
4 changes: 2 additions & 2 deletions Nuget/OrpheusORMMySQLServerHelper.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>OrpheusORMMySQLServerDDLHelper</id>
<version>1.1.3</version>
<version>1.1.4</version>
<title>OrpheusORM MySQL Server DDL Helper</title>
<authors>Trifidis Georgios(Yiorgos)</authors>
<owners>Trifidis Georgios(Yiorgos)</owners>
Expand All @@ -14,7 +14,7 @@
<projectUrl>https://github.com/gtrifidis/OrpheusORM</projectUrl>
<dependencies>
<dependency id="MySql.Data" version="8.0.12" />
<dependency id="OrpheusORM" version="1.1.3" />
<dependency id="OrpheusORM" version="1.1.4" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 2 additions & 2 deletions Nuget/OrpheusORMSQLServerHelper.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>OrpheusORMSQLServerDDLHelper</id>
<version>1.1.3</version>
<version>1.1.4</version>
<title>OrpheusORM SQL Server DDL Helper</title>
<authors>Trifidis Georgios(Yiorgos)</authors>
<owners>Trifidis Georgios(Yiorgos)</owners>
Expand All @@ -14,7 +14,7 @@
<projectUrl>https://github.com/gtrifidis/OrpheusORM</projectUrl>
<dependencies>
<dependency id="System.Data.SqlClient" version="4.5.1" />
<dependency id="OrpheusORM" version="1.1.3" />
<dependency id="OrpheusORM" version="1.1.4" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 3 additions & 1 deletion OrpheusAttributes/OrpheusBaseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
namespace OrpheusAttributes
{
/// <summary>
/// The Orpheus base attribute class.
/// Orpheus base attribute.
/// </summary>
/// <seealso cref="System.Attribute" />
/// <seealso cref="OrpheusInterfaces.Interfaces.Attributes.IOrpheusBaseAttribute" />
public class OrpheusBaseAttribute :Attribute, IOrpheusBaseAttribute
{
}
Expand Down
18 changes: 9 additions & 9 deletions OrpheusAttributes/OrpheusCompositeKeyBaseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ namespace OrpheusAttributes
/// <summary>
/// Composite key attribute, to decorate models that have primary or unique keys that are comprised from than one field.
/// </summary>
/// <seealso cref="OrpheusAttributes.OrpheusBaseAttribute" />
/// <seealso cref="OrpheusInterfaces.Interfaces.Attributes.IOrpheusBaseCompositeKeyAttribute" />
public class OrpheusCompositeKeyBaseAttribute : OrpheusBaseAttribute, IOrpheusBaseCompositeKeyAttribute
{
/// <summary>
/// <value>
/// List of fields that are the key.
/// </summary>
/// <returns>Array of field names</returns>
/// </value>
public string[] Fields { get; private set; }

/// <summary>
/// <value>
/// Sort for the key.
/// </summary>
/// <returns>Sort direction</returns>
/// </value>
public string Sort { get; private set; }

/// <summary>
/// Create a OrpheusCompositeKeyBaseAttribute.
/// Initializes a new instance of the <see cref="OrpheusCompositeKeyBaseAttribute"/> class.
/// </summary>
/// <param name="fields">Fields that are the key </param>
/// <param name="sort">Sort direction for the key </param>
/// <param name="fields">The fields.</param>
/// <param name="sort">The sort direction.</param>
public OrpheusCompositeKeyBaseAttribute(string[] fields,string sort = null):base()
{
this.Fields = fields;
Expand Down
22 changes: 10 additions & 12 deletions OrpheusAttributes/OrpheusDataTypeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace OrpheusAttributes
{

/// <summary>
/// Annotate a property with attribute to set it's DbType
/// </summary>
/// <seealso cref="OrpheusAttributes.OrpheusBaseAttribute" />
public class DataTypeAttribute : OrpheusBaseAttribute
{

/// <summary>
/// Field's data type.
/// Gets the type of the data.
/// </summary>
/// <returns>Data type</returns>
/// <value>
/// The type of the data.
/// </value>
public DbType DataType { get; private set; }

/// <summary>
/// Data type attribute constructor.
/// Initializes a new instance of the <see cref="DataTypeAttribute"/> class.
/// </summary>
/// <param name="dbType">Data type</param>
/// <param name="dbType">Type of the database.</param>
public DataTypeAttribute(DbType dbType)
{
this.DataType = dbType;
}

/// <summary>
/// Data type attribute constructor.
/// Initializes a new instance of the <see cref="DataTypeAttribute"/> class.
/// </summary>
/// <param name="dbType">Casted to System.Data.DbType</param>
/// <param name="dbType">Type of the database.</param>
public DataTypeAttribute(int dbType):this((DbType)dbType)
{

Expand Down
19 changes: 8 additions & 11 deletions OrpheusAttributes/OrpheusDefaultValueAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrpheusAttributes
namespace OrpheusAttributes
{
/// <summary>
/// Default value attribute.
/// Decorate a property with attribute to set it's default value.
/// </summary>
/// <seealso cref="OrpheusAttributes.OrpheusBaseAttribute" />
public class DefaultValue : OrpheusBaseAttribute
{
/// <summary>
/// The default value.
/// Gets the value.
/// </summary>
/// <returns>Default value</returns>
/// <value>
/// The value.
/// </value>
public object Value { get; private set; }

/// <summary>
/// DefaultValue attribute constructor.
/// Initializes a new instance of the <see cref="DefaultValue"/> class.
/// </summary>
/// <param name="value">Property's default value</param>
/// <param name="value">The value.</param>
public DefaultValue(object value)
{
this.Value = value;
Expand Down
16 changes: 8 additions & 8 deletions OrpheusAttributes/OrpheusFieldNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace OrpheusAttributes
namespace OrpheusAttributes
{
/// <summary>
/// FieldName attribute. Decorate a model property with this attribute,
/// to explicitly define the corresponding field name in the db table.
/// </summary>
/// <seealso cref="OrpheusAttributes.OrpheusBaseAttribute" />
public class FieldName : OrpheusBaseAttribute
{
/// <summary>
/// Field name.
/// Gets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; private set; }

/// <summary>
/// Field name constructor.
/// Initializes a new instance of the <see cref="FieldName"/> class.
/// </summary>
/// <param name="fieldName">Field name</param>
/// <param name="fieldName">Name of the field.</param>
public FieldName(string fieldName)
{
this.Name = fieldName;
Expand Down
56 changes: 27 additions & 29 deletions OrpheusAttributes/OrpheusForeignKeyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,48 @@ namespace OrpheusAttributes
/// Primary key constraint attribute.
/// Decorate a property with attribute to create a foreign key constraint on a schema object.
/// </summary>
/// <seealso cref="OrpheusAttributes.OrpheusBaseAttribute" />
/// <seealso cref="OrpheusInterfaces.Interfaces.Attributes.IForeignKey" />
public class ForeignKey : OrpheusBaseAttribute, IForeignKey
{
/// <summary>
/// <value>
/// The foreign key field name.
/// </summary>
/// </value>
public string Field { get; set; }

/// <summary>
/// <value>
/// The reference table.
/// </summary>
/// <returns>The referenced table name</returns>
/// </value>
public string ReferenceTable { get; private set; }

/// <summary>
/// <value>
/// The reference table key.
/// </summary>
/// <returns>The referenced table key</returns>
/// </value>
public string ReferenceField { get; private set; }

/// <summary>
/// <value>
/// Set to true to enable cascade delete.
/// </summary>
/// <returns>Delete cascade flag</returns>
/// </value>
public bool OnDeleteCascade { get; private set; }

/// <summary>
/// <value>
/// Set to true to enable cascade update.
/// </summary>
/// <returns>Update cascade flag</returns>
/// </value>
public bool OnUpdateCascade { get; private set; }

/// <summary>
/// <value>
/// Optional. Set the schema name of the reference table, if there is one.
/// </summary>
public string SchemaName { get; private set; }
/// </value>
public string SchemaName { get; set; }

/// <summary>
/// Foreign key attribute constructor.
/// Initializes a new instance of the <see cref="ForeignKey"/> class.
/// </summary>
/// <param name="referenceTable"></param>
/// <param name="referenceField"></param>
/// <param name="schemaName"></param>
/// <param name="onDeleteCascade"></param>
/// <param name="onUpdateCascade"></param>
/// <param name="referenceTable">The reference table.</param>
/// <param name="referenceField">The reference field.</param>
/// <param name="schemaName">Name of the schema.</param>
/// <param name="onDeleteCascade">if set to <c>true</c> [on delete cascade].</param>
/// <param name="onUpdateCascade">if set to <c>true</c> [on update cascade].</param>
public ForeignKey(string referenceTable, string referenceField,string schemaName = null,bool onDeleteCascade = false, bool onUpdateCascade = false)
{
this.ReferenceField = referenceField;
Expand All @@ -61,13 +59,13 @@ public ForeignKey(string referenceTable, string referenceField,string schemaName
}

/// <summary>
/// Foreign key attribute constructor.
/// Initializes a new instance of the <see cref="ForeignKey"/> class.
/// </summary>
/// <param name="referenceTableType">The referenced table type</param>
/// <param name="referenceField">The referenced field name</param>
/// <param name="schemaName">Schema name</param>
/// <param name="onDeleteCascade">Delete cascade flag</param>
/// <param name="onUpdateCascade">Update cascade flag</param>
/// <param name="referenceTableType">Type of the reference table.</param>
/// <param name="referenceField">The reference field.</param>
/// <param name="schemaName">Name of the schema.</param>
/// <param name="onDeleteCascade">if set to <c>true</c> [on delete cascade].</param>
/// <param name="onUpdateCascade">if set to <c>true</c> [on update cascade].</param>
public ForeignKey(Type referenceTableType, string referenceField,string schemaName = null, bool onDeleteCascade = false, bool onUpdateCascade = false):this(referenceTableType.Name,referenceField,schemaName,onDeleteCascade,onUpdateCascade)
{
}
Expand Down
18 changes: 7 additions & 11 deletions OrpheusAttributes/OrpheusLengthAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrpheusAttributes
namespace OrpheusAttributes
{
/// <summary>
/// Length attribute.
Expand All @@ -14,15 +8,17 @@ namespace OrpheusAttributes
public class Length : OrpheusBaseAttribute
{
/// <summary>
/// The maximum length value.
/// Gets the value.
/// </summary>
/// <returns>Length</returns>
/// <value>
/// The value.
/// </value>
public int Value { get; private set; }

/// <summary>
/// Length attribute constructor.
/// Initializes a new instance of the <see cref="Length"/> class.
/// </summary>
/// <param name="value">The max length value</param>
/// <param name="value">The value.</param>
public Length(int value)
{
this.Value = value;
Expand Down
14 changes: 4 additions & 10 deletions OrpheusAttributes/OrpheusPrimaryCompositeKey.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrpheusAttributes
namespace OrpheusAttributes
{
/// <summary>
/// Primary composite key attribute, to decorate models that have primary or unique keys that are comprised from than one field.
/// </summary>
public class PrimaryCompositeKey : OrpheusCompositeKeyBaseAttribute
{
/// <summary>
/// Primary composite key.
/// Initializes a new instance of the <see cref="PrimaryCompositeKey"/> class.
/// </summary>
/// <param name="fields">Fields that are part of the key</param>
/// <param name="sort">Sort direction</param>
/// <param name="fields">The fields.</param>
/// <param name="sort">The sort direction.</param>
public PrimaryCompositeKey(string[] fields,string sort = null) : base(fields,sort) { }
}
}
Loading

0 comments on commit bca9dbd

Please sign in to comment.