Skip to content

Commit 5cc2ba9

Browse files
committed
[add] Object with string identifier
[R] Expression-body methods
1 parent c7a2b7a commit 5cc2ba9

File tree

11 files changed

+70
-26
lines changed

11 files changed

+70
-26
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Changelog
22

3-
## [1.4.1] - 2021-10-28
3+
## [1.5.0] - 2021-10-28
4+
5+
### Added
6+
7+
- Object with string identifier
48

59
### Dependencies
610

11+
- Simplify.Repository bump to 1.6
712
- Simplify.DI bump to Simplify.DI 4.1.2
813
- Simplify.FluentNHibernate bump to 2.5.1

src/Simplify.Repository.FluentNHibernate/Mappings/IdentityObjectMap.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ public class IdentityObjectMap<T> : ClassMap<T>
1212
/// <summary>
1313
/// Initializes a new instance of the <see cref="IdentityObjectMap{T}"/> class.
1414
/// </summary>
15-
public IdentityObjectMap()
16-
{
17-
Id(x => x.ID);
18-
}
15+
public IdentityObjectMap() => Id(x => x.ID);
1916
}
2017
}

src/Simplify.Repository.FluentNHibernate/Mappings/LongIdentityObjectMap.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ public class LongIdentityObjectMap<T> : ClassMap<T>
1212
/// <summary>
1313
/// Initializes a new instance of the <see cref="LongIdentityObjectMap{T}"/> class.
1414
/// </summary>
15-
public LongIdentityObjectMap()
16-
{
17-
Id(x => x.ID);
18-
}
15+
public LongIdentityObjectMap() => Id(x => x.ID);
1916
}
2017
}

src/Simplify.Repository.FluentNHibernate/Mappings/LongNamedObjectMap.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ public class LongNamedObjectMap<T> : LongIdentityObjectMap<T>
1010
/// <summary>
1111
/// Initializes a new instance of the <see cref="NamedObjectMap{T}"/> class.
1212
/// </summary>
13-
public LongNamedObjectMap()
14-
{
15-
Map(x => x.Name).Not.Nullable();
16-
}
13+
public LongNamedObjectMap() => Map(x => x.Name).Not.Nullable();
1714
}
1815
}

src/Simplify.Repository.FluentNHibernate/Mappings/NamedObjectMap.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ public class NamedObjectMap<T> : IdentityObjectMap<T>
1010
/// <summary>
1111
/// Initializes a new instance of the <see cref="NamedObjectMap{T}"/> class.
1212
/// </summary>
13-
public NamedObjectMap()
14-
{
15-
Map(x => x.Name).Not.Nullable();
16-
}
13+
public NamedObjectMap() => Map(x => x.Name).Not.Nullable();
1714
}
1815
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using FluentNHibernate.Mapping;
2+
3+
namespace Simplify.Repository.FluentNHibernate.Mappings
4+
{
5+
/// <summary>
6+
/// String identity object mapping
7+
/// </summary>
8+
/// <typeparam name="T"></typeparam>
9+
public class StringIdentityObjectMap<T> : ClassMap<T>
10+
where T : IStringIdentityObject
11+
{
12+
/// <summary>
13+
/// Initializes a new instance of the <see cref="IdentityObjectMap{T}"/> class.
14+
/// </summary>
15+
public StringIdentityObjectMap() => Id(x => x.ID);
16+
}
17+
}

src/Simplify.Repository.FluentNHibernate/Simplify.Repository.FluentNHibernate.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1111

12-
<Version>1.4.1</Version>
12+
<Version>1.5</Version>
1313

1414
<Authors>Alexander Krylkov</Authors>
1515
<Product>Simplify</Product>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Simplify.Repository.FluentNHibernate
2+
{
3+
/// <summary>
4+
/// Provides object with string identifier
5+
/// </summary>
6+
public class StringIdentityObject : IStringIdentityObject
7+
{
8+
/// <summary>
9+
/// Gets or sets the identifier.
10+
/// </summary>
11+
/// <value>
12+
/// The identifier.
13+
/// </value>
14+
public virtual string? ID { get; set; }
15+
}
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## [1.6.0] - 2021-10-28
4+
5+
### Added
6+
7+
- Object with string identifier
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Simplify.Repository
2+
{
3+
/// <summary>
4+
/// Represent object with string identifier
5+
/// </summary>
6+
public interface IStringIdentityObject
7+
{
8+
/// <summary>
9+
/// Gets the identifier.
10+
/// </summary>
11+
/// <value>
12+
/// The identifier.
13+
/// </value>
14+
string? ID { get; set; }
15+
}
16+
}

0 commit comments

Comments
 (0)