![]() Var result = entries.Where(e => e.Kanjis.Any(k => k.Priorities & p = p))) Then the answer you were looking for will be like: Priority p = Priority.Frequency1 | Priority.Frequency2 | Priority.Frequenc圓 To check if it has specific priority use bitwise and ( &): if((Priorities & Priority.Frequency1) = Priority.Frequency1 Priorities = Priority.Frequency1 | Priority.Frequency2 // means have both priorities In above consider each Priority as a bit in an int, you can add priority by using bitwise or ( |) : K.Priorities.Contains(Priority.Frequenc圓)Ĭonsidering your 2 questions, I would have made something like this: K.Priorities.Contains(Priority.Frequency2) || Var result = entries.Where(e => e.Kanjis.Any(k => k.Priorities.Contains(Priority.Frequency1) || I hope the information here is enough as it seems difficult to explain what I need to retrieve. Here's a view that I think might help explain the contents: Here's the list: List entries = dictionary.GetEntries().ToList() Where each object contains a list of IKanji objects public interface IKanji public interface IJapaneseDictionaryEntry What I would like to do is to retrieve entries that have an entry that have Priority of "Frequency1" have Priority of "Frequency2" or Priority of "Frequenc圓" from the list entries that I created. I have a rather difficult thing I would like to do and would appreciate any advice / suggestions. Inside this are IKanji objects that contain Priorites objects. I have a List of IJapaneseDictionaryEntry objects which are described below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |