Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:37:38+00:00 2026-06-08T16:37:38+00:00

I have these classes: public class ZoneMember // a zone member is a member

  • 0

I have these classes:

public class ZoneMember
    // a zone member is a member of a zone
    // zonemembers have ports, WWPNs, aliases or all 3
{
    private string _Alias = string.Empty;
    public string MemberAlias {get{return _Alias;} set{_Alias = value; } }
    private FCPort _Port = null;
    public FCPort MemberPort { get { return _Port; } set { _Port = value; } }
    private string _WWPN = string.Empty;
    public string MemberWWPN { get { return _WWPN; } set { _WWPN = value; } }
    private bool _IsLoggedIn;
    public bool IsLoggedIn { get { return _IsLoggedIn; } set { _IsLoggedIn = value; } }
    private string _FCID;
    public string FCID {get{return _FCID;} set{ _FCID=value; } }
}

public class Zone
{ 
    public List<ZoneMember> MembersList = new List<ZoneMember>();
    private string _ZoneName;
    public string zoneName{ get{return _ZoneName;}  set{_ZoneName=value;} }

    public Zone(string n) { zoneName=n; }

}

public class ZoneSet 
{    
    private string _ZoneSetName;
    private int _VSANNum;
    public string ZoneSetName{get{ return _ZoneSetName;}  set{_ZoneSetName=value;} }
    public int VSANNum{ get{ return _VSANNum;}  set{_VSANNum=value;} }
    public bool isActive;
    public List<Zone> ZoneList = new List<Zone>();
}

I want to find all the zones in a Zoneset that have a zone member with a specific value for a property in the MembersList.

I know something like this will work – in this case I am searching on the WWPN property:

// assumes myZoneSet has already been instantiated ad has zones in it
// and inputWWPN in the select statement has the value we want

List<Zone> myZoneList = new List<Zone>();

foreach (Zone z in myZoneset)
{   
var zm=null;

        zm = from member in z.MembersList where member.MemberWWPN == inputWWPN select member;  
  // if we find a matching member, add this zone to the list 
  if (zm != null)
   {  myZoneList.Add(z);
    }
}

Is there a way to use LINQ to do the entire thing? I am not sure what the terminology would be in database terms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:37:40+00:00Added an answer on June 8, 2026 at 4:37 pm

    Try this –

    List<Zone> listOfZone = zoneSet.ZoneList.Where(e => e.Any(p => p.MemberWWPN == inputWWPN)).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have these 2 classes: public class Category { IDictionary<string, CategoryResorce> _resources; } public
I'm developing an application which will have these classes: class Shortcut { public string
I have these classes: public abstract class CustomField { public String Id { get;
if I have these three classes: public class PropertyDouble { private double _value; public
So lets say I have these classes: public class Person { public string Name
I have these classes: public class RegionResult { public string Region { get; set;
I have these classes: @XStreamAlias(person) public class PersonConfig { private AnimalConfig animalConfig; } public
Say I have these classes: public class Loan { @Id private Long id; @ManyToOne
I have these classes: public class MovieExt { public string Title { get; set;
I have a problem with these simple classes: public class Thread { public string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.