This repository has been archived by the owner on Feb 4, 2020. It is now read-only.
-
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.
Fixed UnixDateTimeConverter
- Loading branch information
Constantine Colotiline
committed
Nov 7, 2014
1 parent
09ed59a
commit fecf494
Showing
8 changed files
with
100 additions
and
12 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 |
---|---|---|
|
@@ -154,3 +154,4 @@ $RECYCLE.BIN/ | |
|
||
# Mac desktop service store files | ||
.DS_Store | ||
|
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,26 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Meduza.net.Models.Api { | ||
public sealed class Content { | ||
private readonly string _body; | ||
private readonly string _layoutUri; | ||
private readonly string _description; | ||
public Content( | ||
string body, | ||
[JsonProperty(PropertyName = "layout_url")] string layoutUri, | ||
string description) { | ||
_body = body; | ||
_layoutUri = layoutUri; | ||
_description = description; | ||
} | ||
public string Body { | ||
get { return _body; } | ||
} | ||
public string LayoutUri { | ||
get { return _layoutUri; } | ||
} | ||
public string Description { | ||
get { return _description; } | ||
} | ||
} | ||
} |
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,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Meduza.net.Helpers; | ||
using Meduza.net.Models.Api.Enum; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Meduza.net.Models.Api.Types { | ||
public sealed class News : Document { | ||
public News( | ||
[JsonProperty(PropertyName = "url")] string uri, | ||
string title, | ||
[JsonProperty(PropertyName = "second_title")] string secondTitle, | ||
IReadOnlyList<IReadOnlyList<string>> authors, | ||
|
||
[JsonProperty(PropertyName = "document_type")] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
DocumentType documentType, | ||
|
||
int version, | ||
[JsonProperty(PropertyName = "published_at")] | ||
[JsonConverter(typeof(UnixDateTimeConverter))] DateTime publishedAt, | ||
|
||
[JsonProperty(PropertyName = "updated_at")] | ||
[JsonConverter(typeof(UnixDateTimeConverter))] DateTime updatedAt, | ||
|
||
[JsonProperty(PropertyName = "full")] bool isFull, | ||
Source source, | ||
Image image) | ||
: base( | ||
uri, | ||
title, | ||
secondTitle, | ||
authors, | ||
documentType, | ||
version, | ||
publishedAt, | ||
updatedAt, | ||
isFull, | ||
source, | ||
image) { } | ||
public new Content Content { get; set; } | ||
} | ||
} |
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