Beispiel #1
0
 public Entities.Recent GetById(System.Guid id)
 {
     return(EntityModelFactory.Create(base.DbSet.Where(x => x.Id == id).FirstOrDefault()));
 }
Beispiel #2
0
 public IEnumerable <DrumbleApp.Shared.Entities.PublicTransportOperator> GetAll()
 {
     return(base.DbSet.OrderBy(x => x.Name).Select(x => EntityModelFactory.Create(x)));
 }
 public Entities.PlaceOfInterestCategory GetByCategory(string category)
 {
     return(EntityModelFactory.Create(base.DbSet.Where(x => x.Category == category).SingleOrDefault()));
 }
        public IEnumerable <Entities.PublicStop> GetAll()
        {
            // Filter out operators not selected.
            IEnumerable <OperatorSetting> operatorSettings = Context.OperatorSettings.Where(x => x.IsEnabled);

            return(base.DbSet.Where(x => operatorSettings.Select(y => y.OperatorName).Contains(x.OperatorName)).OrderBy(x => x.Name).Select(x => EntityModelFactory.Create(x)));
        }
 public IEnumerable <Entities.CacheSetting> GetAllCacheSettings()
 {
     return(base.DbSet.Select(x => EntityModelFactory.Create(x)));
 }
 public IEnumerable <Entities.SearchItemCategory> GetAll()
 {
     return(base.DbSet.Select(x => EntityModelFactory.Create(x)));
 }
 public DrumbleApp.Shared.Entities.AppSetting FindByType(ApplicationSetting applicationSetting)
 {
     return(base.DbSet.Where(x => x.ApplicationSetting == applicationSetting).Select(x => EntityModelFactory.Create(x)).Single());
 }
 public DrumbleApp.Shared.Entities.Path GetPinned(Guid tripId, IEnumerable<DrumbleApp.Shared.Entities.PublicTransportOperator> publicTransportOperators)
 {
     return base.DbSet.Where(x => x.IsPinned == true && x.TripId == tripId).Select(x => EntityModelFactory.Create(x, publicTransportOperators)).FirstOrDefault();
 }
 public Entities.PublicStop FindByName(string name)
 {
     return(EntityModelFactory.Create(base.DbSet.Where(x => x.Name.ToLower().Contains(name.ToLower())).FirstOrDefault()));
 }
 public DrumbleApp.Shared.Entities.TransportMode FindByType(ApplicationTransportMode applicationTransportMode)
 {
     return(base.DbSet.Where(x => x.ApplicationTransportMode == applicationTransportMode).Select(x => EntityModelFactory.Create(x)).Single());
 }
 public Entities.PublicStop FindById(Guid publicStopId)
 {
     return(base.DbSet.Where(x => x.Id == publicStopId).Select(x => EntityModelFactory.Create(x)).FirstOrDefault());
 }
        public IEnumerable <Entities.PublicStop> GetByName(string searchText)
        {
            // Filter out operators not selected.
            IEnumerable <OperatorSetting> operatorSettings = Context.OperatorSettings.Where(x => x.IsEnabled);

            return(base.DbSet.Where(x => x.Name.ToLower().Contains(searchText.ToLower()) && operatorSettings.Select(y => y.OperatorName).Contains(x.OperatorName)).OrderBy(x => x.DistanceFromUserLocationInMeters).Take(30).Select(x => EntityModelFactory.Create(x)));
        }
        public IEnumerable <Entities.PublicStop> GetNearby(int limit)
        {
            // Filter out operators not selected.
            IEnumerable <OperatorSetting> operatorSettings = Context.OperatorSettings.Where(x => x.IsEnabled);

            return(base.DbSet.Where(x => operatorSettings.Select(y => y.OperatorName).Contains(x.OperatorName)).OrderBy(x => x.DistanceFromUserLocationInMeters).Take(limit).Select(x => EntityModelFactory.Create(x)));
        }
Beispiel #14
0
 public Entities.PublicTransportOperator GetById(Guid operatorId)
 {
     return(EntityModelFactory.Create(base.DbSet.SingleOrDefault(x => x.Id == operatorId)));
 }
        public Entities.User GetUser()
        {
            User user = base.DbSet.SingleOrDefault();

            return((user == null) ? null : EntityModelFactory.Create(user));
        }
 public IEnumerable<DrumbleApp.Shared.Entities.Path> GetAllCached(IEnumerable<DrumbleApp.Shared.Entities.PublicTransportOperator> publicTransportOperators)
 {
     return base.DbSet.Where(x => x.IsPinned == false).Select(x => EntityModelFactory.Create(x, publicTransportOperators));
 }
Beispiel #17
0
 public IEnumerable <Entities.Recent> GetAll()
 {
     return(base.DbSet.OrderByDescending(x => x.LastUsedDate).Select(x => EntityModelFactory.Create(x)));
 }
 public DrumbleApp.Shared.Entities.Weather Get()
 {
     return(EntityModelFactory.Create(base.DbSet.FirstOrDefault()));
 }
Beispiel #19
0
 public Entities.Recent GetMostRecent()
 {
     return(EntityModelFactory.Create(base.DbSet.OrderByDescending(x => x.LastUsedDate).FirstOrDefault()));
 }
 public Entities.CacheSetting GetByType(Enums.ResourceType resourceType)
 {
     return(EntityModelFactory.Create(base.DbSet.Where(x => x.ResourceType == resourceType).FirstOrDefault()));
 }
Beispiel #21
0
 public Entities.Recent GetMostFrequent()
 {
     return(EntityModelFactory.Create(base.DbSet.OrderByDescending(x => x.NumberOfUses).FirstOrDefault()));
 }
 public IEnumerable <Entities.PlaceOfInterestCategory> GetAll()
 {
     return(base.DbSet.Select(x => EntityModelFactory.Create(x)));
 }
Beispiel #23
0
 public IEnumerable <Entities.Recent> GetByName(string searchText)
 {
     return(base.DbSet.Where(x => x.Text.ToLower().Contains(searchText.ToLower())).OrderByDescending(x => x.LastUsedDate).Select(x => EntityModelFactory.Create(x)));
 }
 public IEnumerable <DrumbleApp.Shared.Entities.UberTrip> GetAll()
 {
     return(base.DbSet.Select(x => EntityModelFactory.Create(x)));
 }
Beispiel #25
0
 public Entities.OperatorSetting GetByOperator(string name)
 {
     return(EntityModelFactory.Create(base.DbSet.SingleOrDefault(x => x.OperatorName == name)));
 }