Skip to content

Commit

Permalink
5.0.1
Browse files Browse the repository at this point in the history
* fixes #196 - InvalidCastException in SaveAsync;
* closes #197 - Add class constraint on entity.
  • Loading branch information
cd21h committed Sep 22, 2019
1 parent d6363f8 commit a89b848
Show file tree
Hide file tree
Showing 29 changed files with 276 additions and 86 deletions.
54 changes: 54 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project>
<PropertyGroup Label="Build">
<Product>Sharp Architecture</Product>
<Authors>Sharp Architecture Dev Team</Authors>

<TargetFrameworks>netstandard2.0</TargetFrameworks>
<SignAssembly>false</SignAssembly>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>

<IsTestProject>false</IsTestProject>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<Optimize>True</Optimize>
</PropertyGroup>

<PropertyGroup Label="Package" Condition="'$(MSBuildProjectName.Contains(Tests))' == false">
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
<IsPackable>True</IsPackable>
<PackageIconUrl>https://github.com/sharparchitecture/Sharp-Architecture/raw/master/Artefacts/Documentation/Logo_100x100.png</PackageIconUrl>
<PackageProjectUrl>http://sharparchitecture.github.io/</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>https://github.com/sharparchitecture/Sharp-Architecture/releases/tag/5.0.0</PackageReleaseNotes>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageTags>sharp-architecture;sharp-arch</PackageTags>
</PropertyGroup>

<PropertyGroup Label="SourceLink">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectName.Contains(Tests))' == true">
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);0618;1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectFullPath.Contains(Sample))' == true ">
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageReference Include="MediatR" Version="6.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="MediatR" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="FluentNHibernate" Version="2.1.2" />
<PackageReference Include="Humanizer.Core" Version="2.5.16" />
<PackageReference Include="Humanizer.Core" Version="2.7.2" />
<PackageReference Include="Iesi.Collections" Version="4.0.4" />
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageReference Include="NHibernate" Version="5.2.1" />
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="NHibernate" Version="5.2.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Iesi.Collections" Version="4.0.4" />
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageReference Include="MediatR" Version="6.0.0" />
<PackageReference Include="NHibernate" Version="5.2.1" />
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="MediatR" Version="7.0.0" />
<PackageReference Include="NHibernate" Version="5.2.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="FluentAssertions" Version="5.5.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="NHibernate" Version="5.2.1" />
<PackageReference Include="Serilog" Version="2.7.1" />
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Moq" Version="4.13.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NHibernate" Version="5.2.6" />
<PackageReference Include="Serilog" Version="2.8.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.109.2" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.111" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.connection_string">Data Source=localhost,2433;Initial Catalog=TardisBank;Integrated Security=False;User ID=sa;Password=Password;Application Name=Suteki.TardisBank;</property>
<property name="connection.connection_string">Data Source=localhost,2433;Initial Catalog=TardisBank;Integrated Security=False;User ID=sa;Password=Password12!;Application Name=Suteki.TardisBank;</property>
<property name="dialect">NHibernate.Dialect.MsSql2012Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.Sql2008ClientDriver</property>
Expand Down
34 changes: 17 additions & 17 deletions Samples/TardisBank/Src/TardisBank.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.29306.81
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Suteki.TardisBank.Domain", "Suteki.TardisBank.Domain\Suteki.TardisBank.Domain.csproj", "{E417A9B0-AC34-44BB-8CFB-B4E5D3CE17D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Suteki.TardisBank.Infrastructure", "Suteki.TardisBank.Infrastructure\Suteki.TardisBank.Infrastructure.csproj", "{D0ACCE2E-D477-4AAF-86DD-6C2C4900B9EE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Suteki.TardisBank.Tasks", "Suteki.TardisBank.Tasks\Suteki.TardisBank.Tasks.csproj", "{80AA7007-BD1D-4860-8D73-BA46C906012A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Suteki.TardisBank.Tests", "Suteki.TardisBank.Tests\Suteki.TardisBank.Tests.csproj", "{25546298-ABBE-41EA-9B62-ABE7C4587D19}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharpArch", "SharpArch", "{B514E7EC-7D43-4DD8-97A9-FD520ECB3B7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TardisBank", "TardisBank", "{6D3106CE-B30A-4DC6-88A4-EE7E09370F48}"
Expand Down Expand Up @@ -40,6 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpArch.Testing.Xunit", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpArch.Infrastructure", "..\..\..\Src\SharpArch.Infrastructure\SharpArch.Infrastructure.csproj", "{45A30CE8-6DBD-4AFB-82C2-E5BD96BB9D4A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Suteki.TardisBank.Tests", "Suteki.TardisBank.Tests\Suteki.TardisBank.Tests.csproj", "{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -86,18 +86,6 @@ Global
{80AA7007-BD1D-4860-8D73-BA46C906012A}.Release|x64.Build.0 = Release|Any CPU
{80AA7007-BD1D-4860-8D73-BA46C906012A}.Release|x86.ActiveCfg = Release|Any CPU
{80AA7007-BD1D-4860-8D73-BA46C906012A}.Release|x86.Build.0 = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|x64.ActiveCfg = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|x64.Build.0 = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|x86.ActiveCfg = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Debug|x86.Build.0 = Debug|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|Any CPU.Build.0 = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|x64.ActiveCfg = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|x64.Build.0 = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|x86.ActiveCfg = Release|Any CPU
{25546298-ABBE-41EA-9B62-ABE7C4587D19}.Release|x86.Build.0 = Release|Any CPU
{AE52B0E4-022D-45E0-AB04-010FACA6C897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE52B0E4-022D-45E0-AB04-010FACA6C897}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE52B0E4-022D-45E0-AB04-010FACA6C897}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -206,6 +194,18 @@ Global
{45A30CE8-6DBD-4AFB-82C2-E5BD96BB9D4A}.Release|x64.Build.0 = Release|Any CPU
{45A30CE8-6DBD-4AFB-82C2-E5BD96BB9D4A}.Release|x86.ActiveCfg = Release|Any CPU
{45A30CE8-6DBD-4AFB-82C2-E5BD96BB9D4A}.Release|x86.Build.0 = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|x64.ActiveCfg = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|x64.Build.0 = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|x86.ActiveCfg = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Debug|x86.Build.0 = Debug|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|Any CPU.Build.0 = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|x64.ActiveCfg = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|x64.Build.0 = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|x86.ActiveCfg = Release|Any CPU
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -214,7 +214,6 @@ Global
{E417A9B0-AC34-44BB-8CFB-B4E5D3CE17D2} = {FCDFE7DD-5575-47CA-B4C0-5D02EBA4A4A1}
{D0ACCE2E-D477-4AAF-86DD-6C2C4900B9EE} = {FCDFE7DD-5575-47CA-B4C0-5D02EBA4A4A1}
{80AA7007-BD1D-4860-8D73-BA46C906012A} = {FCDFE7DD-5575-47CA-B4C0-5D02EBA4A4A1}
{25546298-ABBE-41EA-9B62-ABE7C4587D19} = {1CB314F4-5E98-4A3A-8017-FB5F8CD8A76F}
{FCDFE7DD-5575-47CA-B4C0-5D02EBA4A4A1} = {6D3106CE-B30A-4DC6-88A4-EE7E09370F48}
{1CB314F4-5E98-4A3A-8017-FB5F8CD8A76F} = {6D3106CE-B30A-4DC6-88A4-EE7E09370F48}
{AE52B0E4-022D-45E0-AB04-010FACA6C897} = {B514E7EC-7D43-4DD8-97A9-FD520ECB3B7D}
Expand All @@ -226,6 +225,7 @@ Global
{F47EC00C-58C9-4E8A-BB80-CDB2C492DBF6} = {B514E7EC-7D43-4DD8-97A9-FD520ECB3B7D}
{CDF31748-EA55-4C67-B571-160F432E592C} = {B514E7EC-7D43-4DD8-97A9-FD520ECB3B7D}
{45A30CE8-6DBD-4AFB-82C2-E5BD96BB9D4A} = {B514E7EC-7D43-4DD8-97A9-FD520ECB3B7D}
{25EA8BD3-9E0C-48C2-B784-1229A7D8EF16} = {1CB314F4-5E98-4A3A-8017-FB5F8CD8A76F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB1F64E9-9827-4B3E-AC78-5D56782B8A7D}
Expand Down
2 changes: 2 additions & 0 deletions SharpArch.AutoLoad.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ FluentAssertions.AssertionExtensions.Should($EXPR$).NotBeNull()&#xD;
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">RequiredForMultiline</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_USING/@EntryValue">RequiredForMultiline</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">RequiredForMultiline</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String>



Expand Down
3 changes: 2 additions & 1 deletion Src/Common/NHibernate/TestDatabaseSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class TestDatabaseSetup : IDisposable
public TestDatabaseSetup([NotNull] string basePath, [NotNull] Assembly[] mappingAssemblies)
{
_basePath = basePath ?? throw new ArgumentNullException(nameof(basePath));
_mappingAssemblies = mappingAssemblies ?? throw new ArgumentNullException(nameof(mappingAssemblies));
if (mappingAssemblies == null) throw new ArgumentNullException(nameof(mappingAssemblies));
_mappingAssemblies = mappingAssemblies.Distinct().ToArray();
}


Expand Down
1 change: 1 addition & 0 deletions Src/SharpArch.Domain/PersistenceSupport/ILinqRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
/// <typeparam name="T">The entity type.</typeparam>
[PublicAPI]
public interface ILinqRepository<T> : ILinqRepositoryWithTypedId<T, int>
where T : class
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace SharpArch.Domain.PersistenceSupport
/// </remarks>
[PublicAPI]
public interface ILinqRepositoryWithTypedId<T, in TId> : IRepositoryWithTypedId<T, TId>
where T: class
{
/// <summary>
/// Finds an item by ID.
Expand Down
1 change: 1 addition & 0 deletions Src/SharpArch.Domain/PersistenceSupport/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
/// </remarks>
[PublicAPI]
public interface IRepository<T> : IRepositoryWithTypedId<T, int>
where T: class
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SharpArch.Domain.PersistenceSupport
/// <typeparam name="TId">The type of the entity ID.</typeparam>
[PublicAPI]
public interface IRepositoryWithTypedId<T, in TId>
where T: class
{
/// <summary>
/// Returns the database context, which provides a handle to application wide DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ public static class RepositoryExtensions
/// <summary>
/// Saves the specified object to the repository and evicts it from the session.
/// </summary>
/// <exception cref="ArgumentNullException"><paramref name="repository" /> is <see langword="null" />.</exception>
public static void SaveAndEvict<T, TId>(this IRepositoryWithTypedId<T, TId> repository, T entity)
/// <exception cref="ArgumentNullException"><paramref name="repository" /> or <paramref name="entity"/> is <see langword="null" />.</exception>
public static void SaveAndEvict<T, TId>([NotNull] this IRepositoryWithTypedId<T, TId> repository, [NotNull] T entity)
where T: class
{
if (repository == null) throw new ArgumentNullException(nameof(repository));
if (entity == null) throw new ArgumentNullException(nameof(entity));
repository.Evict(repository.Save(entity));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ namespace SharpArch.NHibernate.Contracts.Repositories
/// </summary>
[PublicAPI]
public interface INHibernateRepository<T> : INHibernateRepositoryWithTypedId<T, int>, IRepository<T>
where T : class
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace SharpArch.NHibernate.Contracts.Repositories
/// <seealso cref="SharpArch.Domain.PersistenceSupport.IRepositoryWithTypedId{T, TId}" />
[PublicAPI]
public interface INHibernateRepositoryWithTypedId<T, in TId> : IRepositoryWithTypedId<T, TId>
where T: class
{
/// <summary>
/// Looks for zero or more instances using the properties provided.
Expand Down
1 change: 1 addition & 0 deletions Src/SharpArch.NHibernate/LinqRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/// <seealso cref="SharpArch.Domain.PersistenceSupport.ILinqRepository{T}" />
[PublicAPI]
public class LinqRepository<T> : LinqRepositoryWithTypedId<T, int>, ILinqRepository<T>
where T : class
{
/// <summary>
/// Initializes a new instance of the <see cref="LinqRepository{T}" /> class.
Expand Down
1 change: 1 addition & 0 deletions Src/SharpArch.NHibernate/LinqRepositoryWithTypedId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace SharpArch.NHibernate
/// <seealso cref="SharpArch.Domain.PersistenceSupport.ILinqRepositoryWithTypedId{T, TId}" />
[PublicAPI]
public class LinqRepositoryWithTypedId<T, TId> : NHibernateRepositoryWithTypedId<T, TId>, ILinqRepositoryWithTypedId<T, TId>
where T : class
{
/// <summary>
/// Initializes a new instance of the <see cref="LinqRepositoryWithTypedId{T, TId}" /> class.
Expand Down
1 change: 1 addition & 0 deletions Src/SharpArch.NHibernate/NHibernateRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/// </summary>
[PublicAPI]
public class NHibernateRepository<T> : NHibernateRepositoryWithTypedId<T, int>, INHibernateRepository<T>
where T : class
{
/// <summary>
/// Initializes a new instance of the <see cref="NHibernateRepository{T}" /> class.
Expand Down
6 changes: 3 additions & 3 deletions Src/SharpArch.NHibernate/NHibernateRepositoryWithTypedId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace SharpArch.NHibernate
[PublicAPI]
public class NHibernateRepositoryWithTypedId<T, TId> : INHibernateRepositoryWithTypedId<T, TId>,
IAsyncNHibernateRepositoryWithTypedId<T, TId>

where T: class
{
/// <summary>
/// Gets NHibernate session.
Expand Down Expand Up @@ -156,8 +156,8 @@ public Task<T> LoadAsync(
/// <inheritdoc />
public async Task<T> SaveAsync(T entity, CancellationToken cancellationToken = default(CancellationToken))
{
var res = await Session.SaveAsync(entity, cancellationToken).ConfigureAwait(false);
return (T) res;
await Session.SaveAsync(entity, cancellationToken).ConfigureAwait(false);
return entity;
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace SharpArch.RavenDb.Contracts.Repositories
/// <seealso cref="SharpArch.Domain.PersistenceSupport.IRepository{T}" />
[PublicAPI]
public interface IRavenDbRepository<T> : IRavenDbRepositoryWithTypedId<T, int>, IRepository<T>
where T : class
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace SharpArch.RavenDb.Contracts.Repositories
/// Todo: Consider replacing lambda with expression tree.
[PublicAPI]
public interface IRavenDbRepositoryWithTypedId<T, in TIdT> : IRepositoryWithTypedId<T, TIdT>
where T: class
{
/// <summary>
/// RavenDB Document Session.
Expand Down
3 changes: 2 additions & 1 deletion Src/SharpArch.RavenDb/RavenDbRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace SharpArch.RavenDb
public class RavenDbRepository<T> : RavenDbRepositoryWithTypedId<T, int>,
IRavenDbRepository<T>,
ILinqRepository<T>
where T : class
{
/// <summary>
/// Initializes a new instance of the <see cref="RavenDbRepository{T}"/> class.
Expand All @@ -27,4 +28,4 @@ public RavenDbRepository(IDocumentSession session) : base(session)
{
}
}
}
}
1 change: 1 addition & 0 deletions Src/SharpArch.RavenDb/RavenDbRepositoryWithTypedId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace SharpArch.RavenDb
[PublicAPI]
public class RavenDbRepositoryWithTypedId<T, TIdT> : IRavenDbRepositoryWithTypedId<T, TIdT>,
ILinqRepositoryWithTypedId<T, TIdT>
where T: class
{
/// <summary>
/// Initializes a new instance of the <see cref="RavenDbRepositoryWithTypedId{T, TIdT}"/> class.
Expand Down
Loading

0 comments on commit a89b848

Please sign in to comment.