-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
677111d
commit 5017590
Showing
42 changed files
with
259 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
...ntityFramework/Options/EntityMapperKey.cs → ...appers.EntityFramework/EntityMapperKey.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Detached.Mappers.EntityFramework/Options/EntityMapperOptionsBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Detached.Mappers.Options; | ||
|
||
namespace Detached.Mappers.EntityFramework.Options | ||
{ | ||
public class EntityMapperOptionsBuilder : MapperOptionsBuilder | ||
{ | ||
public EntityMapperOptionsBuilder(EntityMapperOptions options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public EntityMapperOptionsBuilder() | ||
: base(new EntityMapperOptions()) | ||
{ | ||
} | ||
|
||
public new EntityMapperOptions Options => (EntityMapperOptions)base.Options; | ||
|
||
public EntityMapperOptionsBuilder AddProfile(object profileKey, Action<MapperOptionsBuilder> configure) | ||
{ | ||
var options = Options.Profiles.GetOrAdd(profileKey, key => new MapperOptions()); | ||
|
||
var builder = new MapperOptionsBuilder(options); | ||
|
||
configure?.Invoke(builder); | ||
|
||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Detached.Mappers.Types; | ||
using Detached.Mappers.Types.Class; | ||
using Detached.Mappers.Types.Class.Builder; | ||
|
||
namespace Detached.Mappers.Options | ||
{ | ||
public class MapperOptionsBuilder | ||
{ | ||
public MapperOptionsBuilder(MapperOptions options) | ||
{ | ||
Options = options; | ||
} | ||
|
||
public MapperOptionsBuilder() | ||
{ | ||
Options = new MapperOptions(); | ||
} | ||
|
||
public MapperOptions Options { get; } | ||
|
||
public virtual ClassTypeBuilder<TType> Type<TType>() | ||
{ | ||
IType type = Options.GetTypeConfiguration(typeof(TType)); | ||
|
||
return new ClassTypeBuilder<TType>((ClassType)type, Options); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.