Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class 내 property간의 계산이 불가한 문제 #8

Closed
snrbs17 opened this issue Dec 16, 2020 · 1 comment
Closed

class 내 property간의 계산이 불가한 문제 #8

snrbs17 opened this issue Dec 16, 2020 · 1 comment

Comments

@snrbs17
Copy link
Owner

snrbs17 commented Dec 16, 2020

FakeAccountInfo를 일별 혹은 월별로 구분하기 위해 List를 date에 따라 grouping 진행함
Group 내에서 각 property의 총합을 구하고 싶으나 list의 형태라 property를 특정해 가져올 수 없음

@snrbs17
Copy link
Owner Author

snrbs17 commented Dec 16, 2020

        var value = Clients.FakeAccountInfoes.GetFakeAccountInfoesAsync().Result
            .GroupBy(x => x.Date.Day, x => x,
            (day, info) => new {Info.Sales.Sum()}

대신
var value = Clients.FakeAccountInfoes.GetFakeAccountInfoesAsync().Result
.GroupBy(x => x.Date.Day, x => x,
(day, info) => new {Info.Sum(x => x.Sales)}
형태로 사용

@snrbs17 snrbs17 closed this as completed Dec 16, 2020
@snrbs17 snrbs17 reopened this Dec 16, 2020
@snrbs17 snrbs17 closed this as completed Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant