Exemple #1
0
 public static async Task <string> GetAsync(this List <Tracker> tracker, TrackerEnum key)
 {
     return(await Task.Factory.StartNew(() =>
                                        tracker.FirstOrDefault(u => u.AttributeName.ToLower().Contains(key.ToString()))?.AttributeValue ?? ""));
 }
Exemple #2
0
        private static async Task <string> Convert(List <Tracker> trackers, TrackerEnum key)
        {
            var val = "";

            if (trackers == null || trackers.Count == 0)
            {
                return(val);
            }
            var userTracker = new UserTracker();
            await Task.Run(() =>
            {
                var tracker = trackers.FirstOrDefault(u => u.AttributeName.ToLower().Contains(key.ToString()));
                if (tracker != null)
                {
                    val = tracker.AttributeValue;
                }
            });

            return(val);
        }
Exemple #3
0
 public static string Get(this List <Tracker> tracker, TrackerEnum key)
 {
     return(tracker.FirstOrDefault(u => u.AttributeName.ToLower().Contains(key.ToString()))?.AttributeValue ?? "");
 }