Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.

Commit 690df4b

Browse files
authored
Merge pull request #141 from eraydin/dev
Minor consolidations, and .NET Core migration of NHibernate
2 parents 1b31dfc + 923bef7 commit 690df4b

File tree

18 files changed

+26
-53
lines changed

18 files changed

+26
-53
lines changed

build.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var testProjects = new List<Tuple<string, string[]>>
3131
new Tuple<string, string[]>("Stove.Tests.SampleApplication", new[] { "net461" }),
3232
new Tuple<string, string[]>("Stove.Dapper.Tests", new[] { "net461" }),
3333
new Tuple<string, string[]>("Stove.Hangfire.Tests", new[] { "netcoreapp2.0" }),
34-
new Tuple<string, string[]>("Stove.NHibernate.Tests", new[] { "net461" }),
34+
new Tuple<string, string[]>("Stove.NHibernate.Tests", new[] { "netcoreapp2.0" }),
3535
new Tuple<string, string[]>("Stove.EntityFrameworkCore.Tests", new[] { "netcoreapp2.0" }),
3636
new Tuple<string, string[]>("Stove.Serilog.Tests", new[] { "netcoreapp2.0" })
3737
};

src/Stove.EntityFrameworkCore/EntityFrameworkCore/StoveDbContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
using Microsoft.EntityFrameworkCore.ChangeTracking;
1616
using Microsoft.EntityFrameworkCore.Metadata;
1717

18-
using Stove.Collections.Extensions;
1918
using Stove.Commands;
2019
using Stove.Domain.Entities;
2120
using Stove.Domain.Entities.Auditing;
2221
using Stove.Domain.Uow;
23-
using Stove.Events;
2422
using Stove.Events.Bus;
2523
using Stove.Events.Bus.Entities;
2624
using Stove.Extensions;

src/Stove.NHibernate/NHibernate/StoveNHibernateBootstrapper.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using System;
22
using System.Linq;
3-
4-
using NHibernate.Util;
5-
3+
64
using Stove.Bootstrapping;
7-
using Stove.Domain.Uow;
5+
using Stove.Extensions;
86
using Stove.NHibernate.Configuration;
97
using Stove.NHibernate.Interceptors;
108

src/Stove.NHibernate/Stove.NHibernate.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<RootNamespace>Stove</RootNamespace>
88
<AssemblyName>Stove.NHibernate</AssemblyName>
99
<PackageId>Stove.NHibernate</PackageId>
10-
<PackageTags>.net;framework;boilerplate;nhibernate</PackageTags>
10+
<PackageTags>.net;core;framework;boilerplate;nhibernate</PackageTags>
1111
<RootNamespace>Stove</RootNamespace>
1212
<Description>NHibernate Orm integration for Stove.</Description>
1313
</PropertyGroup>
@@ -24,11 +24,7 @@
2424

2525
<ItemGroup>
2626
<ProjectReference Include="..\Stove\Stove.csproj" />
27-
</ItemGroup>
28-
29-
<ItemGroup>
30-
<Reference Include="System.Transactions" />
31-
</ItemGroup>
27+
</ItemGroup>
3228

3329
<ItemGroup>
3430
<None Include="bin\Release\netstandard2.0\Stove.NHibernate.pdb">

src/Stove.Redis/Redis/DefaultRedisCacheSerializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class DefaultRedisCacheSerializer : IRedisCacheSerializer, ITransientDepe
1818
/// </summary>
1919
/// <param name="objbyte">String representation of the object from the Redis server.</param>
2020
/// <returns>Returns a newly constructed object.</returns>
21-
/// <seealso cref="IRedisCacheSerializer.Serialize" />
21+
/// <seealso cref="Serialize" />
2222
public virtual object Deserialize(RedisValue objbyte)
2323
{
2424
return JsonSerializationHelper.DeserializeWithType(objbyte);
@@ -30,7 +30,7 @@ public virtual object Deserialize(RedisValue objbyte)
3030
/// <param name="value">Instance to serialize.</param>
3131
/// <param name="type">Type of the object.</param>
3232
/// <returns>Returns a string representing the object instance that can be placed into the Redis cache.</returns>
33-
/// <seealso cref="IRedisCacheSerializer.Deserialize" />
33+
/// <seealso cref="Deserialize" />
3434
public virtual string Serialize(object value, Type type)
3535
{
3636
return JsonSerializationHelper.SerializeWithType(value, type);

src/Stove/BackgroundJobs/BackgroundJob.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public IUnitOfWorkManager UnitOfWorkManager
3030
{
3131
if (_unitOfWorkManager == null)
3232
{
33-
throw new StoveException("Must set UnitOfWorkManager before use it.");
33+
throw new StoveException($"Must set {nameof(UnitOfWorkManager)} before use it.");
3434
}
3535

3636
return _unitOfWorkManager;
File renamed without changes.

src/Stove/Events/Bus/Entities/AggregateChangeReport.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23

34
namespace Stove.Events.Bus.Entities
45
{
@@ -13,7 +14,7 @@ public AggregateChangeReport()
1314

1415
public bool IsEmpty()
1516
{
16-
return DomainEvents.Count <= 0;
17+
return !DomainEvents.Any();
1718
}
1819

1920
public override string ToString()

src/Stove/Reflection/Extensions/MemberInfoExtensions.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Reflection;
45

56
using JetBrains.Annotations;
67

7-
using Stove.Domain.Uow;
8-
98
namespace Stove.Reflection.Extensions
109
{
1110
public static class MemberInfoExtensions
@@ -26,13 +25,13 @@ public static TAttribute GetSingleAttributeOrNull<TAttribute>(this MemberInfo me
2625
throw new ArgumentNullException(nameof(memberInfo));
2726
}
2827

29-
var attrs = memberInfo.GetCustomAttributes(typeof(TAttribute), inherit).ToList();
30-
if (attrs.Count > 0)
28+
List<object> attrs = memberInfo.GetCustomAttributes(typeof(TAttribute), inherit).ToList();
29+
if (attrs.Any())
3130
{
3231
return (TAttribute)attrs[0];
3332
}
3433

35-
return default(TAttribute);
34+
return default;
3635
}
3736

3837
[CanBeNull]

test/Stove.Demo.WebApi/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
using HibernatingRhinos.Profiler.Appender.EntityFramework;
3+
// using HibernatingRhinos.Profiler.Appender.EntityFramework;
44

55
using Microsoft.Owin.Hosting;
66

0 commit comments

Comments
 (0)