-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from AArnott/warningClean
Fix compiler warnings
- Loading branch information
Showing
5 changed files
with
14 additions
and
8 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
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
using System; | ||
using System; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace SignService.Utils | ||
{ | ||
public sealed class CoreContractResolver : DefaultContractResolver | ||
{ | ||
readonly IServiceProvider _provider; | ||
readonly IServiceProvider provider; | ||
|
||
public CoreContractResolver(IServiceProvider provider) | ||
{ | ||
_provider = provider; | ||
this.provider = provider; | ||
} | ||
|
||
protected override JsonObjectContract CreateObjectContract(Type objectType) | ||
{ | ||
var contract = base.CreateObjectContract(objectType); | ||
var svc = _provider.GetService(objectType); | ||
var svc = provider.GetService(objectType); | ||
if (svc != null) | ||
{ | ||
contract.DefaultCreator = () => _provider.GetService(objectType); | ||
contract.DefaultCreator = () => provider.GetService(objectType); | ||
} | ||
|
||
return contract; | ||
} | ||
|
||
} | ||
} | ||
} |