public static List <hccUserProfileNote> GetBy(int userProfileId, Enums.UserProfileNoteTypes noteType) { try { using (var cont = new healthychefEntities()) { var t = cont.hccUserProfileNotes .Where(a => a.UserProfileID == userProfileId && a.NoteTypeID == (int)noteType) .OrderBy(a => a.DateCreated) .ToList(); return(t); } } catch { throw; } }
public static List <hccUserProfileNote> GetBy(int userProfileId, Enums.UserProfileNoteTypes noteType, bool?areViewableByUser) { try { if (areViewableByUser == null) { return(GetBy(userProfileId, noteType)); } else { return(GetBy(userProfileId, noteType).Where(a => a.DisplayToUser == areViewableByUser).ToList()); } } catch { throw; } }