-
Notifications
You must be signed in to change notification settings - Fork 1
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 #17 from bbonkr/dev
Remove JsonService #16
- Loading branch information
Showing
7 changed files
with
91 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
/** | ||
* Remove JsonService #16 | ||
* | ||
*/ | ||
//using System; | ||
//using System.Collections.Generic; | ||
//using System.Text; | ||
|
||
namespace kr.bbon.Xamarin.Forms.Abstractions | ||
{ | ||
public interface IJsonService | ||
{ | ||
/// <summary> | ||
/// 직렬화 합니다. | ||
/// </summary> | ||
/// <param name="obj"></param> | ||
/// <returns></returns> | ||
string Serialize(object obj); | ||
//namespace kr.bbon.Xamarin.Forms.Abstractions | ||
//{ | ||
// public interface IJsonService | ||
// { | ||
// /// <summary> | ||
// /// 직렬화 합니다. | ||
// /// </summary> | ||
// /// <param name="obj"></param> | ||
// /// <returns></returns> | ||
// string Serialize(object obj); | ||
|
||
/// <summary> | ||
/// 역직렬화합니다. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="json"></param> | ||
/// <returns></returns> | ||
T Deserialize<T>(string json); | ||
} | ||
} | ||
// /// <summary> | ||
// /// 역직렬화합니다. | ||
// /// </summary> | ||
// /// <typeparam name="T"></typeparam> | ||
// /// <param name="json"></param> | ||
// /// <returns></returns> | ||
// T Deserialize<T>(string json); | ||
// } | ||
//} |
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 |
---|---|---|
|
@@ -14,6 +14,11 @@ | |
|
||
## 변경 Changes | ||
|
||
### 1.2.0 | ||
|
||
- JsonService 제거 | ||
- Newtonsoft.Json 의존 제거 | ||
|
||
### 1.1.2 | ||
|
||
- 패키지 이미지 추가 | ||
|
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,56 +1,61 @@ | ||
using kr.bbon.Xamarin.Forms.Abstractions; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
/** | ||
* Remove JsonService #16 | ||
* | ||
*/ | ||
|
||
namespace kr.bbon.Xamarin.Forms.Services | ||
{ | ||
public class JsonService: IJsonService | ||
{ | ||
/// <summary> | ||
/// 직렬화 합니다. | ||
/// </summary> | ||
/// <param name="obj"></param> | ||
/// <returns></returns> | ||
public string Serialize(object obj) | ||
{ | ||
return JsonConvert.SerializeObject(obj, GetDefaultSettings()); | ||
} | ||
//using kr.bbon.Xamarin.Forms.Abstractions; | ||
//using Newtonsoft.Json; | ||
//using Newtonsoft.Json.Serialization; | ||
//using System; | ||
//using System.Collections.Generic; | ||
//using System.Text; | ||
|
||
/// <summary> | ||
/// 역직렬화합니다. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="json"></param> | ||
/// <returns></returns> | ||
public T Deserialize<T>(string json) | ||
{ | ||
T obj = JsonConvert.DeserializeObject<T>(json, GetDefaultSettings()); | ||
//namespace kr.bbon.Xamarin.Forms.Services | ||
//{ | ||
// public class JsonService: IJsonService | ||
// { | ||
// /// <summary> | ||
// /// 직렬화 합니다. | ||
// /// </summary> | ||
// /// <param name="obj"></param> | ||
// /// <returns></returns> | ||
// public string Serialize(object obj) | ||
// { | ||
// return JsonConvert.SerializeObject(obj, GetDefaultSettings()); | ||
// } | ||
|
||
return obj; | ||
} | ||
// /// <summary> | ||
// /// 역직렬화합니다. | ||
// /// </summary> | ||
// /// <typeparam name="T"></typeparam> | ||
// /// <param name="json"></param> | ||
// /// <returns></returns> | ||
// public T Deserialize<T>(string json) | ||
// { | ||
// T obj = JsonConvert.DeserializeObject<T>(json, GetDefaultSettings()); | ||
|
||
private JsonSerializerSettings GetDefaultSettings() | ||
{ | ||
return new JsonSerializerSettings | ||
{ | ||
// JSON 객체 속성 이름을 camelCase 형태로 처리합니다. | ||
ContractResolver = new CamelCasePropertyNamesContractResolver(), | ||
// 열거형 값을 문자열로 저장합니다. | ||
//options.Converters.Add(new StringEnumConverter()); | ||
// 들여쓰기 형식을 지원합니다. | ||
Formatting = Formatting.Indented, | ||
// null 값을 가진 속성에 대한 직렬화/역직렬화 과정의 에러를 무시합니다. | ||
NullValueHandling = NullValueHandling.Ignore, | ||
// 정의되지 않은 멤버에 대한 직렬화/역직렬화 과정의 에러를 무시합니다. | ||
MissingMemberHandling = MissingMemberHandling.Ignore, | ||
// return obj; | ||
// } | ||
|
||
DateParseHandling = DateParseHandling.DateTimeOffset, | ||
DateFormatHandling = DateFormatHandling.IsoDateFormat, | ||
DateTimeZoneHandling = DateTimeZoneHandling.Utc, | ||
}; | ||
} | ||
} | ||
} | ||
// private JsonSerializerSettings GetDefaultSettings() | ||
// { | ||
// return new JsonSerializerSettings | ||
// { | ||
// // JSON 객체 속성 이름을 camelCase 형태로 처리합니다. | ||
// ContractResolver = new CamelCasePropertyNamesContractResolver(), | ||
// // 열거형 값을 문자열로 저장합니다. | ||
// //options.Converters.Add(new StringEnumConverter()); | ||
// // 들여쓰기 형식을 지원합니다. | ||
// Formatting = Formatting.Indented, | ||
// // null 값을 가진 속성에 대한 직렬화/역직렬화 과정의 에러를 무시합니다. | ||
// NullValueHandling = NullValueHandling.Ignore, | ||
// // 정의되지 않은 멤버에 대한 직렬화/역직렬화 과정의 에러를 무시합니다. | ||
// MissingMemberHandling = MissingMemberHandling.Ignore, | ||
|
||
// DateParseHandling = DateParseHandling.DateTimeOffset, | ||
// DateFormatHandling = DateFormatHandling.IsoDateFormat, | ||
// DateTimeZoneHandling = DateTimeZoneHandling.Utc, | ||
// }; | ||
// } | ||
// } | ||
//} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageId>kr.bbon.Xamarin.Forms</PackageId> | ||
<Title>kr.bbon.Xamarin.Forms</Title> | ||
<Version>1.1.2</Version> | ||
<Version>1.2.0</Version> | ||
<Authors>Pon Cheol Ku ([email protected])</Authors> | ||
<Company>bbon.kr</Company> | ||
<Copyright>bbon.kr. All rights reserved.</Copyright> | ||
|
@@ -24,7 +24,6 @@ | |
<PackageReference Include="Microsoft.AppCenter" Version="4.*" /> | ||
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.*" /> | ||
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.*" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.*" /> | ||
<PackageReference Include="Autofac" Version="6.*" /> | ||
</ItemGroup> | ||
|
||
|