/// <summary> /// Tries to get the detail identified by <paramref name="id"/> and fills <paramref name="dossierDetailData"/> /// with the retrieved detail. /// </summary> /// <param name="dossierData"></param> /// <param name="id">The id of the detail to retrieve.</param> /// <param name="dossierDetailData">The detail to fill with the retrieval result.</param> /// <returns></returns> public static bool TryGetDetail(this DossierData dossierData, int id, out DossierDetailData dossierDetailData) { if (!dossierData.HasDetail(id)) { dossierDetailData = null; return(false); } dossierDetailData = dossierData.GetDetail(id); return(true); }
/// <summary> /// Checks if this dossier contains the detail as specified in <paramref name="dossierDetailData"/>. /// </summary> /// <param name="dossierData"></param> /// <param name="dossierDetailData">The detail to check for existance.</param> /// <returns></returns> public static bool HasDetail(this DossierData dossierData, DossierDetailData dossierDetailData) { return(dossierData.HasDetail(dossierDetailData.Id)); }