GET api/News/GetNewsById/{id}

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

integer

Required

Body Parameters

None.

Response Information

Resource Description

NewsDTO
NameDescriptionTypeAdditional information
id

integer

None.

title

string

None.

body

string

None.

publishTime

date

None.

likeCount

integer

None.

commentCount

integer

None.

imageOrgName

string

None.

imageBase64

string

None.

imageUrl

string

None.

slug

string

None.

listNewsCommentDTO

Collection of NewsCommentDTO

None.

listNewsRelated

Collection of NewsDTO

None.

NewsTypeId

integer

None.

NewsType

NewsType

None.

isLiked

boolean

None.

isActive

boolean

None.

registerTime

date

None.

updateTime

date

None.

newsType

NewsTypeDTO

None.

success

boolean

None.

Response Formats

application/json

Sample:

An exception has occurred while using the formatter 'JsonMediaTypeFormatter' to generate sample for media type 'application/json'. Exception message: Self referencing loop detected with type 'Application.DTOs.NewsDTO'. Path 'listNewsRelated'.

text/json

Sample:

An exception has occurred while using the formatter 'JsonMediaTypeFormatter' to generate sample for media type 'text/json'. Exception message: Self referencing loop detected with type 'Application.DTOs.NewsDTO'. Path 'listNewsRelated'.

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Object graph for type 'System.Collections.Generic.List`1[[Application.DTOs.NewsDTO, Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Object graph for type 'System.Collections.Generic.List`1[[Application.DTOs.NewsDTO, Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' contains cycles and cannot be serialized if reference tracking is disabled.