-
Notifications
You must be signed in to change notification settings - Fork 0
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
62fe728
commit 719be05
Showing
13 changed files
with
577 additions
and
94 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
...arks/Generated/MapperGenerator/MapperGenerator.MapperGenerator/CreateMapperAttribute.g.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
3 changes: 1 addition & 2 deletions
3
...ests/Generated/MapperGenerator/MapperGenerator.MapperGenerator/CreateMapperAttribute.g.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
49 changes: 49 additions & 0 deletions
49
...er.FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost.g.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,49 @@ | ||
using DotNetThoughts.Results; | ||
using System.Text.Json; | ||
|
||
namespace FartingUnicorn.Generated; | ||
|
||
public static partial class Mappers | ||
{ | ||
public static Result<FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost> MapToFartingUnicorn_Tests_SingleField_ReferenceType_NonNullableOptional_Tests_BlogPost(JsonElement jsonElement, string[] path = null) | ||
{ | ||
/*object*/ | ||
{ | ||
if (jsonElement.ValueKind != JsonValueKind.Object) | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost>.Error(new ValueHasWrongTypeError(path, "Object", jsonElement.ValueKind.ToString())); | ||
} | ||
} | ||
var obj = new FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost(); | ||
|
||
Result<Unit> compositeResult = UnitResult.Ok; | ||
var isTitlePropertyDefined = jsonElement.TryGetProperty("Title", out var jsonTitleProperty); | ||
if (isTitlePropertyDefined) | ||
{ | ||
// Option | ||
if (mapResult.Success) | ||
{ | ||
obj.Title = mapResult.Value; | ||
} | ||
else | ||
{ | ||
compositeResult = compositeResult.Or(mapResult); | ||
} | ||
} | ||
else | ||
{ | ||
} | ||
if(!compositeResult.Success) | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost>.Error(compositeResult.Errors); | ||
} | ||
if(false)/*check if is option*/ | ||
{ | ||
} | ||
else | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NonNullableOptional_Tests.BlogPost>.Ok(obj); | ||
} | ||
throw new NotImplementedException(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...apper.FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost.g.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,49 @@ | ||
using DotNetThoughts.Results; | ||
using System.Text.Json; | ||
|
||
namespace FartingUnicorn.Generated; | ||
|
||
public static partial class Mappers | ||
{ | ||
public static Result<FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost> MapToFartingUnicorn_Tests_SingleField_ReferenceType_NullableOptional_Tests_BlogPost(JsonElement jsonElement, string[] path = null) | ||
{ | ||
/*object*/ | ||
{ | ||
if (jsonElement.ValueKind != JsonValueKind.Object) | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost>.Error(new ValueHasWrongTypeError(path, "Object", jsonElement.ValueKind.ToString())); | ||
} | ||
} | ||
var obj = new FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost(); | ||
|
||
Result<Unit> compositeResult = UnitResult.Ok; | ||
var isTitlePropertyDefined = jsonElement.TryGetProperty("Title", out var jsonTitleProperty); | ||
if (isTitlePropertyDefined) | ||
{ | ||
// Option | ||
if (mapResult.Success) | ||
{ | ||
obj.Title = mapResult.Value; | ||
} | ||
else | ||
{ | ||
compositeResult = compositeResult.Or(mapResult); | ||
} | ||
} | ||
else | ||
{ | ||
} | ||
if(!compositeResult.Success) | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost>.Error(compositeResult.Errors); | ||
} | ||
if(false)/*check if is option*/ | ||
{ | ||
} | ||
else | ||
{ | ||
return Result<FartingUnicorn.Tests.SingleField.ReferenceType.NullableOptional_Tests.BlogPost>.Ok(obj); | ||
} | ||
throw new NotImplementedException(); | ||
} | ||
} |
Oops, something went wrong.