public async Task <IStarSystemList> GetStarsInCoordinateRangeAsync(double Xmin, double Ymin, double Zmin, double Xmax, double Ymax, double Zmax)
        {
            var context = new AstronomicalDataContext();
            var query   = await context.GetProcedures().pGetStarsInCoordinateRangeAsync(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);

            var stars = query.ToList();

            return(MapToCoreModelList(stars));
        }
        public async Task <IStarSystem> GetStarSystemAsync(int id)
        {
            var context = new AstronomicalDataContext();
            var query   = await context.HygData.FindAsync(id);

            var star = query;

            return(MapToCoreModel(star));
        }
        public async Task <int> GetCountOfStarsInCoordinateRangeAsync(double Xmin, double Ymin, double Zmin, double Xmax, double Ymax, double Zmax)
        {
            var result = new pGetCountOfStarsInCoordinateRangeResult();

            try
            {
                var context = new AstronomicalDataContext();
                var query   = await context.GetProcedures().pGetCountOfStarsInCoordinateRangeAsync(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);

                result = query.FirstOrDefault();
            }
            catch
            {
                return(-1);
            }
            return(result.Count.HasValue ? result.Count.Value : 0);
        }