Skip to content

Perform SUM over array of objects #9

Description

@lbdm

Hi,

I need to create a rule to sum a property of an array of objects.
For example:

public class Stops(){
public string Description {get;set;}
public int Duration {get;set;}
public int Type {get;set;}
}

var array = new Stops[4];
.....

I need to write rule to sum the property Duration where Type==1 for example.
How can I do?
thanks to give me an example.
Laura

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions