Skip to content

Commit 3e7cbe7

Browse files
Implement abstract OneWay and TwoWay profiles
1 parent 0b2fdc0 commit 3e7cbe7

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using AutoMapper;
2+
3+
namespace Ace.CSharp.StructuredAutoMapper.Abstractions;
4+
5+
public abstract class AbstractOneWayProfile<TLeft, TRight>
6+
: Profile, IOneWayProfile<TLeft, TRight>
7+
where TLeft : class
8+
where TRight : class
9+
{
10+
protected AbstractOneWayProfile()
11+
{
12+
ConfigureLeftToRightMapping();
13+
}
14+
15+
public abstract void ConfigureLeftToRightMapping();
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using AutoMapper;
2+
3+
namespace Ace.CSharp.StructuredAutoMapper.Abstractions;
4+
5+
public abstract class AbstractTwoWayProfile<TLeft, TRight>
6+
: Profile, ITwoWayProfile<TLeft, TRight>
7+
where TLeft : class
8+
where TRight : class
9+
{
10+
protected AbstractTwoWayProfile()
11+
{
12+
ConfigureLeftToRightMapping();
13+
ConfigureRightToLeftMapping();
14+
}
15+
16+
public abstract void ConfigureLeftToRightMapping();
17+
18+
public abstract void ConfigureRightToLeftMapping();
19+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Ace.CSharp.StructuredAutoMapper.Abstractions;
2+
3+
public interface IOneWayProfile<in TLeft, in TRight>
4+
where TLeft : class
5+
where TRight : class
6+
{
7+
void ConfigureLeftToRightMapping();
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Ace.CSharp.StructuredAutoMapper.Abstractions;
2+
3+
public interface ITwoWayProfile<in TLeft, in TRight>
4+
where TLeft : class
5+
where TRight : class
6+
{
7+
void ConfigureLeftToRightMapping();
8+
void ConfigureRightToLeftMapping();
9+
}

0 commit comments

Comments
 (0)