Skip to content

Commit

Permalink
Modified creation/revision handlers so that options are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuck committed Jan 22, 2022
1 parent f7e8736 commit ce07276
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public class CreationHandler<TEntity, TKey, TScope, TRecord> : CreationHandlerBa

#region Constructors

public CreationHandler(CreationOptions options, IMapper mapper) : base(options, mapper) { }
public CreationHandler(IMapper mapper) : base(mapper) { }

public CreationHandler(IMapper mapper, CreationOptions options) : base(mapper, options) { }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class RevisionHandler<TEntity, TKey, TScope, TRecord> : RevisionHandlerBa
{
#region Constructors

public RevisionHandler(RevisionOptions options, IMapper mapper) : base(options, mapper) { }
public RevisionHandler(IMapper mapper) : base(mapper) { }

public RevisionHandler(IMapper mapper, RevisionOptions options) : base(mapper, options) { }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Product>YuckQi.Data</Product>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>An implementation of YuckQi.Data for MongoDB databases.</Description>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>An implementation of YuckQi.Data for MySQL databases using Dapper and SimpleCRUD.</Description>
<Product>YuckQi.Data</Product>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>An implementation of YuckQi.Data for Oracle databases using Dapper and SimpleCRUD.</Description>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Product>YuckQi.Data</Product>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>An implementation of YuckQi.Data for MSSQL databases using Dapper and SimpleCRUD.</Description>
<Product>YuckQi.Data</Product>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
Expand Down
4 changes: 3 additions & 1 deletion src/YuckQi.Data.Sql.Dapper/Handlers/CreationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class CreationHandler<TEntity, TKey, TScope, TRecord> : CreationHandlerBa
{
#region Constructors

public CreationHandler(CreationOptions options, IMapper mapper) : base(options, mapper) { }
public CreationHandler(IMapper mapper) : base(mapper) { }

public CreationHandler(IMapper mapper, CreationOptions options) : base(mapper, options) { }

#endregion

Expand Down
4 changes: 3 additions & 1 deletion src/YuckQi.Data.Sql.Dapper/Handlers/RevisionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class RevisionHandler<TEntity, TKey, TScope, TRecord> : RevisionHandlerBa
{
#region Constructors

public RevisionHandler(RevisionOptions options, IMapper mapper) : base(options, mapper) { }
public RevisionHandler(IMapper mapper) : base(mapper) { }

public RevisionHandler(IMapper mapper, RevisionOptions options) : base(mapper, options) { }

#endregion

Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Data.Sql.Dapper/YuckQi.Data.Sql.Dapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>An implementation of YuckQi.Data for SQL databases using Dapper and SimpleCRUD.</Description>
<Product>YuckQi.Data</Product>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>An implementation of YuckQi.Data for SQL databases using Entity Framework.</Description>
<Product>YuckQi.Data</Product>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
Expand Down
8 changes: 5 additions & 3 deletions src/YuckQi.Data/Handlers/Abstract/CreationHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ public abstract class CreationHandlerBase<TEntity, TKey, TScope, TRecord> : ICre

#region Constructors

protected CreationHandlerBase(CreationOptions options, IMapper mapper)
{
_options = options ?? new CreationOptions();
protected CreationHandlerBase(IMapper mapper) : this(mapper, null) { }

protected CreationHandlerBase(IMapper mapper, CreationOptions options)
{
Mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));

_options = options ?? new CreationOptions();
}

#endregion
Expand Down
8 changes: 5 additions & 3 deletions src/YuckQi.Data/Handlers/Abstract/RevisionHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ public abstract class RevisionHandlerBase<TEntity, TKey, TScope, TRecord> : IRev

#region Constructors

protected RevisionHandlerBase(RevisionOptions options, IMapper mapper)
{
_options = options ?? new RevisionOptions();
protected RevisionHandlerBase(IMapper mapper) : this(mapper, null) { }

protected RevisionHandlerBase(IMapper mapper, RevisionOptions options)
{
Mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));

_options = options ?? new RevisionOptions();
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Data/YuckQi.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>2.1.4</Version>
<Version>2.2.0</Version>
<Description>A .NET library of lightweight data access handlers which can be used to compose repositories and domain services.</Description>
<RepositoryUrl>https://github.com/Yuck/YuckQi.Data.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down

0 comments on commit ce07276

Please sign in to comment.