예제 #1
0
        public IEnumerable <ActivityViewModel> GetActivitiesByZip(string zip, int miles)
        {
            List <ActivityViewModel> ret = new List <ActivityViewModel>();

            var activities = _allReadyDataAccess.ActivitiesByPostalCode(zip, miles);

            foreach (Activity activity in activities)
            {
                ret.Add(new ActivityViewModel(activity));
            }

            return(ret);
        }
예제 #2
0
        public IEnumerable <ActivityViewModel> GetCampaignsByPostalCode(string zip, int miles)
        {
            List <ActivityViewModel> ret = new List <ActivityViewModel>();

            var campaigns = (from c in _allReadyDataAccess.ActivitiesByPostalCode(zip, miles)
                             select c.Campaign).Distinct();

            var activities = (from c in campaigns
                              from p in c.Activities
                              select p);

            foreach (Activity activity in activities)
            {
                ret.Add(new ActivityViewModel(activity));
            }

            return(ret);
        }
 public List <Models.Activity> Handle(AcitivitiesByPostalCodeQuery message)
 {
     return(dataAccess.ActivitiesByPostalCode(message.PostalCode, message.Distance).ToList());
 }