public bool isOwnerOfPartnership(int partnershipID) { return(PartnershipDetails .Where(x => x.Type.ToLower() == "owner") .Select(x => x.PartnershipID) .Contains(partnershipID)); }
public List <Profile> getPartners() { return(PartnershipDetails .Where(x => x.Type.ToLower() != "owner") .Select(x => x.Profile) .ToList()); }
/// <summary> /// Returns a list of owned partnerships /// </summary> /// <returns>Null if no owned partnership found</returns> public List <Partnership> getOwnedPartnerships() { try { var partnerships = PartnershipDetails .Where(x => x.Type.ToLower() == "owner") .Select(x => x.Partnership).ToList(); return(partnerships); } catch (Exception) { return(null); } }
public List <Profile> getOwners() { try { return(PartnershipDetails .Where(x => x.Type.ToLower() == "owner") .Select(x => x.Profile) .ToList()); } catch (Exception) { return(null); } }
/// <summary> /// Determines whether the current profile is already associated with /// the provided partnership /// </summary> /// <param name="partnershipID"></param> /// <returns></returns> public bool isNewToPartnership(int partnershipID) { var partnerships = PartnershipDetails .Where(x => x.PartnershipID == partnershipID) .Count(); if (partnerships > 0) { return(false); } else { return(true); } }
public int partnershipCount() { return(PartnershipDetails.Count()); }
//helpers /// <summary> /// get all partners of this partnership /// including owner /// </summary> /// <returns></returns> public List <Profile> getAllPartners() { return(PartnershipDetails.Select(x => x.Profile).ToList()); }