public static GAPPSF.Core.Data.GeocacheType GetGeocacheType(string keyWord, int minID) { GAPPSF.Core.Data.GeocacheType result = null; keyWord = keyWord.ToLower(); result = (from gt in ApplicationData.Instance.GeocacheTypes where gt.ID >= minID && gt.Name.ToLower().Contains(keyWord) orderby gt.ID select gt).FirstOrDefault(); if (result == null) { //take special ID result = GetGeocacheType(0); } return(result); }
public static GAPPSF.Core.Data.GeocacheType GetGeocacheType(int typeId) { GAPPSF.Core.Data.GeocacheType result = null; result = (from gt in ApplicationData.Instance.GeocacheTypes where gt.ID == typeId select gt).FirstOrDefault(); if (result == null) { //take special ID result = (from gt in ApplicationData.Instance.GeocacheTypes where gt.ID == 0 select gt).FirstOrDefault(); } return(result); }