Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

c# - C#模型-添加元素和元素列表(C# model - add single and List of elements)

I am using .NET Core.

(我正在使用.NET Core。)

I have a class which has a string party and a List Accounts and a List Amounts.

(我有一堂课,有一个字符串聚会,一个列表帐户和一个列表金额。)

I want to be able to populate this class - I am unsure how.

(我希望能够填充此类-我不确定如何。)

The class is:

(该类是:)

public class pivotTest
{
    public string Party { get; set; }
    IList<string> Accounts { get; set; }
    IList<double?> Amount { get; set; }
}

Now with this class, there's one party with many accounts and amounts, an example would be:

(现在,在这个课程中,有一个拥有许多帐户和金额的一方,例如:)

Jerry
Bank1 1000
Bank2 500
Bank 200

Thomas
Bank1 3000
Bank2  500

And ideally, I would like it to displayed like this.

(理想情况下,我希望这样显示。)

How would I go about populating this class?

(我将如何填充该课程?)

  ask by NoobCoder translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...