TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
C# Corner
Tech Writer
7
459
How do I create a list of values in C# ?
Dec 15 2018 6:35 AM
How to create a list of values in C# based on the following data?
I have the following which I need to be converted into list:
Players: [
{
Player: {
PlayerType: Advanced,
PlayerRole: 12
}
}
]
}
and I did this
public
class
Players
{
public
Players()
{
Player =
new
PlayerMemo();
}
[JsonProperty(
"Player"
)]
public
Player Player {
get
;
set
; }
}
public
class
Player
{
public
string
PlayerRole {
get
;
set
; }
public
string
PlayerType {
get
;
set
; }
}
I need to convert this into one line list and add it to the previously declared
localvariable.list = here-goes-my-one-line-list: (something like this)
loadgroup.Players =
new
Players()
{
{
new
Players() {
"PlayerRole"
,
"Member"
} },
};
Reply
Answers (
3
)
how to send notification email with a method to cal. date
Why We need Classes if we can Write code in Form View Code.