/// <summary> /// Get a subset of this species fact list by quality. /// </summary> /// <param name="quality">The quality for the requested species facts.</param> /// <returns>A species fact list.</returns> public SpeciesFactList GetSpeciesFacts(ISpeciesFactQuality quality) { SpeciesFactList speciesFacts = new SpeciesFactList(); var subset = from SpeciesFact speciesFact in this where speciesFact.Quality == quality select speciesFact; if (subset.IsNotNull() && subset.Any()) { speciesFacts.AddRange(subset.ToArray()); } return(speciesFacts); }
/// <summary> /// Get a subset of this species fact list based on parameters. /// </summary> /// <param name="individualCategory">The individual category for the requested species facts.</param> /// <returns>A species fact list.</returns> public SpeciesFactList GetSpeciesFacts(IIndividualCategory individualCategory) { SpeciesFactList speciesFacts = new SpeciesFactList(); var subset = from SpeciesFact speciesFact in this where speciesFact.IndividualCategory.Id == individualCategory.Id select speciesFact; if (subset.IsNotNull() && subset.Any()) { speciesFacts.AddRange(subset.ToArray()); } return(speciesFacts); }
/// <summary> /// Get a subset of this species fact list based on parameters. /// </summary> /// <param name="period">The period for the requested species facts.</param> /// <returns>A species fact list.</returns> public SpeciesFactList GetSpeciesFacts(IPeriod period) { SpeciesFactList speciesFacts = new SpeciesFactList(); var subset = from SpeciesFact speciesFact in this where speciesFact.Period == period select speciesFact; if (subset.IsNotNull() && subset.Any()) { speciesFacts.AddRange(subset.ToArray()); } return(speciesFacts); }
/// <summary> /// Get a subset of this species fact list based on parameters. /// </summary> /// <param name="factor">The factor for the requested species facts.</param> /// <returns>A species fact list.</returns> public SpeciesFactList GetSpeciesFacts(IFactor factor) { SpeciesFactList speciesFacts = new SpeciesFactList(); var subset = from SpeciesFact speciesFact in this where speciesFact.Factor.Id == factor.Id orderby speciesFact.Taxon.SortOrder ascending select speciesFact; if (subset.IsNotNull() && subset.Any()) { speciesFacts.AddRange(subset.ToArray()); } return(speciesFacts); }
/// <summary> /// Get a subset of this species fact list based on parameters. /// </summary> /// <param name="taxon">The taxon for the requested species facts.</param> /// <param name="individualCategory">The individual category for the requested species facts.</param> /// <param name="factor">The factor for the requested species facts.</param> /// <param name="period">The period for the requested species facts.</param> /// <returns>A species fact list.</returns> public SpeciesFactList GetSpeciesFacts(ITaxon taxon, IIndividualCategory individualCategory, IFactor factor, IPeriod period) { SpeciesFactList speciesFacts = new SpeciesFactList(); var subset = from SpeciesFact speciesFact in this where speciesFact.Taxon.Id == taxon.Id && speciesFact.IndividualCategory.Id == individualCategory.Id && speciesFact.Factor.Id == factor.Id && (speciesFact.Period.IsNull() || (speciesFact.Period.Id == period.Id)) select speciesFact; if (subset.IsNotNull() && subset.Any()) { speciesFacts.AddRange(subset.ToArray()); } return(speciesFacts); }