Add LiteDb in all repositories
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using LiteDB;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
public class AircraftRepository : IAircraftRepository
|
||||
@@ -16,11 +15,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
IEnumerable<Aircraft> result = new List<Aircraft>();
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/Aircraft.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
result = jsonResult.ToObject<IEnumerable<Aircraft>>();
|
||||
var col = db.GetCollection<Aircraft>("Aircraft");
|
||||
|
||||
result = col.FindAll().ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -30,12 +29,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
Aircraft result;
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/Aircraft.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
var tmp = jsonResult.ToObject<IEnumerable<Aircraft>>();
|
||||
result = tmp.SingleOrDefault(t => t.Id == id);
|
||||
var col = db.GetCollection<Aircraft>("Aircraft");
|
||||
|
||||
result = col.FindById(new BsonValue(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Pilatus"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Caravan"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Skyvan"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Twin Otter"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "PAC 750"
|
||||
}
|
||||
]
|
||||
@@ -1,975 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.4305",
|
||||
"longitude": "5.40197",
|
||||
"name": "iFLY - Aix/Marseille",
|
||||
"address": "Decathlon Village - La Petite Bastide</br>Avenue des Chabauds, RN8</br>13320 Bouc-Bel-Air",
|
||||
"website": "www.iflyfrance.com",
|
||||
"email": "contact@iflyaixmarseille.fr",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.42851765",
|
||||
"longitude": "4.48127962577103",
|
||||
"name": "Brienne - Aube Parachutisme",
|
||||
"address": "Aérodrome de Brienne Le Château</br>10500 Préçy-Saint-Martin",
|
||||
"website": "www.aubeparachutisme.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.78266",
|
||||
"longitude": "3.00485",
|
||||
"name": "Ice Mountain Adventure Park",
|
||||
"address": "Rue de Capelle 16</br>7780 Comines-Warneton - Belgique",
|
||||
"website": "www.ice-mountain.com",
|
||||
"email": "indoorskydiving@ice-mountain.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "-21.82105",
|
||||
"longitude": "165.86077",
|
||||
"name": "La Foa",
|
||||
"address": "Aérodrome de La Foa Ouatom (Nouvelle-Calédonie)",
|
||||
"website": "www.cepnc.com",
|
||||
"email": "cepnc1@gmail.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.00109",
|
||||
"longitude": "4.75815",
|
||||
"name": "Skydive Pujaut",
|
||||
"address": "",
|
||||
"website": "www.skydive-pujaut.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.60392",
|
||||
"longitude": "3.91888",
|
||||
"name": "Montpellier - Twistair",
|
||||
"address": "Odysseum</br>34 000 Montpellier",
|
||||
"website": "www.twist-air.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.45564",
|
||||
"longitude": "6.03411",
|
||||
"name": "Gap - CERPS",
|
||||
"address": "Aérodrome de Gap Tallard</br>630 rue Pierre-Georges Latécoère</br>05130 Tallard",
|
||||
"website": "parachutismegap.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.898776",
|
||||
"longitude": "6.838590",
|
||||
"name": "Rock Drop",
|
||||
"address": "",
|
||||
"website": "www.rock-drop.com",
|
||||
"email": "contact@rock-drop.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "51.01451",
|
||||
"longitude": "5.52507",
|
||||
"name": "Zwartberg Skydive Flanders",
|
||||
"address": "Vliegplein 1, 3600 Genk",
|
||||
"website": "www.skydiveflanders.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "51.00225",
|
||||
"longitude": "5.06817",
|
||||
"name": "Schaffen Skydive Flanders",
|
||||
"address": "Nieuwe Dijkstraat 44, 3290 Schaffen",
|
||||
"website": "www.skydiveflanders.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.84966",
|
||||
"longitude": "3.14724",
|
||||
"name": "Moorsele Skydive Flanders",
|
||||
"address": "Ledegemstraat 140, 8560 Moorsele",
|
||||
"website": "www.skydiveflanders.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.82826",
|
||||
"longitude": "4.82633",
|
||||
"name": "Châlon sur Sâone - Sky Circus",
|
||||
"address": "71530 Aérodrome de Chalon-Champforgeuil",
|
||||
"website": "www.chutelibre-shop.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.21733",
|
||||
"longitude": "0.07492",
|
||||
"name": "Tarbes - CEP de la Bigorre",
|
||||
"address": "Aérodrome de Laloubère</br>65310 Laloubère",
|
||||
"website": "www.parachutisme-tarbes.fr",
|
||||
"email": "cepb65@gmail.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.86957",
|
||||
"longitude": "2.38775",
|
||||
"name": "Amiens - Amiens Parachutisme",
|
||||
"address": "Aérodrome d'Amiens-Glisy</br>Rue Robur le Conquérant</br>80440 Glisy",
|
||||
"website": "www.sauterenparachute.com",
|
||||
"email": "contact@sauterenparachute.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.27358",
|
||||
"longitude": "5.07270",
|
||||
"name": "Dijon - BFCP",
|
||||
"address": "Aéroport de Dijon Bourgogne</br>1925 Rue de l'aviation</br>21600 Ouges",
|
||||
"website": "",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "41.65905",
|
||||
"longitude": "8.89382",
|
||||
"name": "Corse - EP du Valinco",
|
||||
"address": "Aérodrome Tavaria - BP28</br>20110 Propriano",
|
||||
"website": "www.corseparachutisme.fr",
|
||||
"email": "info@skydivecorsica.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.86880",
|
||||
"longitude": "5.18445",
|
||||
"name": "Lyon - Ciel dAventure",
|
||||
"address": "20 rue Caillet</br>69001 Lyon",
|
||||
"website": "www.cieldav.com",
|
||||
"email": "contact@cieldav.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.59473",
|
||||
"longitude": "7.09306",
|
||||
"name": "Château-d'Oex - EPCO",
|
||||
"address": "l'aérodrome de la Gruyère, à Epagny et l'aérodrome de Colombier",
|
||||
"website": "www.skydive-gruyere.ch",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.42730",
|
||||
"longitude": "-0.28856",
|
||||
"name": "Pau - Paradise 64",
|
||||
"address": "Aérodrome de Lasclaveries</br>64450 Lasclaverie",
|
||||
"website": "www.paradise64.fr",
|
||||
"email": "contact@paradise64.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "-21.609549",
|
||||
"longitude": "165.400054",
|
||||
"name": "Nouméa - Nouméa Skydive",
|
||||
"address": "BP 18545</br>98857 Nouméa Cedex",
|
||||
"website": "www.parachutisme.nc",
|
||||
"email": "max@parachutisme.nc",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "-21.32013",
|
||||
"longitude": "55.42761",
|
||||
"name": "La Réunion - Para-club de Bourbon",
|
||||
"address": "Aérodrome de Pierrefonds</br>97410 St Pierre",
|
||||
"website": "www.para-bourbon.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "37.29609",
|
||||
"longitude": "-6.16122",
|
||||
"name": "Séville - Skydive Spain",
|
||||
"address": "Aerodromo La Juliana</br>Bollullos de la Mitaciu00f3n",
|
||||
"website": "www.skydivespain.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "39.99553",
|
||||
"longitude": "0.02519",
|
||||
"name": "Castellon - Skytime",
|
||||
"address": "Aérodrome El PinarCamino de La Plana</br>12100 El Grao",
|
||||
"website": "www.skytime.info",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "37.14756",
|
||||
"longitude": "-8.58114",
|
||||
"name": "Algarve - Skydive Algarve",
|
||||
"address": "Aerodrome de Portimão - Montes de Alvor</br>8500-059 Portimão/Alvor</br>Portugal",
|
||||
"website": "www.skydivealgarve.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "42.25968",
|
||||
"longitude": "3.10908",
|
||||
"name": "Empuriabrava - Skydive Empuria",
|
||||
"address": "Ampuriabrava - Gerona - 17487",
|
||||
"website": "www.skydiveempuriabrava.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.15202",
|
||||
"longitude": "4.38704",
|
||||
"name": "Cerfontaine - Skydive Cerfontaine",
|
||||
"address": "Route des Lacs</br>50 - B5630 Cerfontaine",
|
||||
"website": "www.skydivecerfontaine.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.2575",
|
||||
"longitude": "6.9867",
|
||||
"name": "Bex - Flying Devil",
|
||||
"address": "Aérodrome de Bex</br>1880 Bex Suisse",
|
||||
"website": "www.Flying-Devil.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.47998",
|
||||
"longitude": "5.91407",
|
||||
"name": "Spa - Skydive Spa",
|
||||
"address": "122 route de la sauvenière</br>B-4900 Spa",
|
||||
"website": "www.skydivespa.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "42.257868",
|
||||
"longitude": "3.108497",
|
||||
"name": "Empuriabrava - Windoor Realfly",
|
||||
"address": "Sector Aeroclub</br>17486 Empuriabrava, Giron, Spain",
|
||||
"website": "www.windoor-realfly.com",
|
||||
"email": "Proflyer@windoor-realfly.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.64516",
|
||||
"longitude": "5.46701",
|
||||
"name": "Liège - Fly-In",
|
||||
"address": "8 Rue de l'aéroport</br>B-4460 Grâce Hollogne</br>Liège, Belgique",
|
||||
"website": "www.fly-in.be",
|
||||
"email": "",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.58383",
|
||||
"longitude": "3.09533",
|
||||
"name": "Lille - Weembi",
|
||||
"address": "730 Rue Maurice Herzog</br>59810 Lesquin",
|
||||
"website": "www.weembi.com",
|
||||
"email": "info@weembi.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.72502",
|
||||
"longitude": "4.93902",
|
||||
"name": "Lyon Saint-Priest - iFLY Lyon",
|
||||
"address": "Aéroport de Lyon-Bron</br>48 ancienne route de Grenoble</br>69800 Saint-Priest",
|
||||
"website": "www.iflyfrance.com",
|
||||
"email": "info.lyon@iflyworld.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.22094",
|
||||
"longitude": "7.35205",
|
||||
"name": "Sion - Realfly",
|
||||
"address": "1950 Sion</br>Suisse 58, Route de la Drague",
|
||||
"website": "www.realfly.ch",
|
||||
"email": "",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.72723",
|
||||
"longitude": "-2.72502",
|
||||
"name": "Vannes - EPS Vannes-Bretagne",
|
||||
"address": "Aérodrome de Vannes-Meucon</br>1-2 Rue Kersimon</br>56250 Monterblanc",
|
||||
"website": "www.parachutisme-vannes.fr",
|
||||
"email": "accueil@parachutisme-vannes.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.25469",
|
||||
"longitude": "-0.10831",
|
||||
"name": "Saumur - CERPS",
|
||||
"address": "118 rue des Landes</br>BP 33 - 49426 Saumur cedex",
|
||||
"website": "www.saumur-parachutisme.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.55473",
|
||||
"longitude": "7.78487",
|
||||
"name": "Strasbourg - CERP Alsace",
|
||||
"address": "Aérodrome du Polygone</br>67100 Strasbourg 82 rue de la Musau",
|
||||
"website": "alsace-para.com",
|
||||
"email": "info@alsace-para.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.98379",
|
||||
"longitude": "3.77448",
|
||||
"name": "Saint Florentin - Paris Jump",
|
||||
"address": "Aérodrome de Chéu</br>89600 St Florentin",
|
||||
"website": "www.parisjump.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.60574",
|
||||
"longitude": "4.30375",
|
||||
"name": "Saint Etienne - A.S.P.L./C.E.P.",
|
||||
"address": "Aérodrome de Saint-Galmier</br>42330 - Saint-Galmier",
|
||||
"website": "www.para42.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.63339",
|
||||
"longitude": "-0.97613",
|
||||
"name": "Royan - Europhénix 17",
|
||||
"address": "Aérodrome de Royan-Médis</br>17600 Médis",
|
||||
"website": "www.europhenix17.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.05209",
|
||||
"longitude": "4.00329",
|
||||
"name": "Roanne - Skydive Roanne",
|
||||
"address": "42155 Aérodrome de Roanne",
|
||||
"website": "www.skydiveroanne.fr",
|
||||
"email": "info@skydiveroanne.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.87168",
|
||||
"longitude": "3.04032",
|
||||
"name": "Péronne - CPPPHS",
|
||||
"address": "CPPPHS SARL - BP 80051</br>80201 Péronne Cedex",
|
||||
"website": "www.skydive-peronne.fr",
|
||||
"email": "skydive.peronne@gmail.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.09240",
|
||||
"longitude": "1.69954",
|
||||
"name": "Pamiers - CEPS Ariège",
|
||||
"address": "Aérodrome de Pamiers les Pujols</br>09101 Pamiers",
|
||||
"website": "www.parachutisme-pamiers.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.42730",
|
||||
"longitude": "-0.28856",
|
||||
"name": "Pau - Parachutisme Passion",
|
||||
"address": "Aérodrome</br>64450 Lasclaveries",
|
||||
"website": "www.pau-skydive.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.90230",
|
||||
"longitude": "2.16910",
|
||||
"name": "Orléans - EPCOL",
|
||||
"address": "Aéroport du Loiret</br>45550 - Saint Denis de l'Hôtel",
|
||||
"website": "parachutisme-orleans.net",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.31478",
|
||||
"longitude": "-0.40147",
|
||||
"name": "Niort - Démenciel Parachutisme",
|
||||
"address": "Aérodrome de Niort Marais - Poitevin</br>Avenue de Limoges - 79000 Niort",
|
||||
"website": "www.demencielparachutisme.com",
|
||||
"email": "contact@demencielparachutisme.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.07020",
|
||||
"longitude": "4.14399",
|
||||
"name": "Neemes - Accel-air",
|
||||
"address": "Aérodrome de Nu00eemes-Courbessac</br>Hangar, chemin de l'aérodrome</br>30000 Nu00eemes Courbessac</br></br>-Aérodrome de Millau La Cavalerie</br>Route départemental 809</br>12230 La Cavalerie",
|
||||
"website": "www.accel-air.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.59240",
|
||||
"longitude": "6.24500",
|
||||
"name": "Nancy - EFP Nancy Lorraine",
|
||||
"address": "Aérodrome de Nancy Azelot</br>54210 Azelot",
|
||||
"website": "www.paranancy.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.99906",
|
||||
"longitude": "3.10917",
|
||||
"name": "Nevers - CP Paris-Nevers",
|
||||
"address": "Aéroport de Nevers Fourchambault</br>58180 Nevers",
|
||||
"website": "www.paraparisnevers.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.14793",
|
||||
"longitude": "-1.16311",
|
||||
"name": "Mimizan - OJB Parachutisme",
|
||||
"address": "Aérodrome de Mimizan</br>40200 Mimizan",
|
||||
"website": "www.ojbpara.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.49204",
|
||||
"longitude": "6.79114",
|
||||
"name": "Montbéliard - EPNFC",
|
||||
"address": "Aérodrome de Courcelles lès Montbéliard</br>25420 Courcelles",
|
||||
"website": "www.epnfc.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.31594",
|
||||
"longitude": "4.02990",
|
||||
"name": "Maubeuge - CERPM",
|
||||
"address": "Aérodrome de la Salmagne</br>59600 Vieux Reng",
|
||||
"website": "www.skydivemaubeuge.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.65804",
|
||||
"longitude": "4.91376",
|
||||
"name": "Lyon - EPLC",
|
||||
"address": "Rue Clément Ader</br>69960 Corbas",
|
||||
"website": "parachutisme-lyon.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.46500",
|
||||
"longitude": "2.82039",
|
||||
"name": "Lens - CERP Lens",
|
||||
"address": "Aérodrome Lens - Bénifontaine</br>62410 Bénifontaine",
|
||||
"website": "www.lens-parachutisme.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.03037",
|
||||
"longitude": "-0.74492",
|
||||
"name": "Laval - Centre école de la Mayenne",
|
||||
"address": "Parachutisme Laval</br>Chemin de l'Etronnier - 53000",
|
||||
"website": "www.parachutismelaval.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.20504",
|
||||
"longitude": "-1.50625",
|
||||
"name": "Lessay - EP de Lessay",
|
||||
"address": "Aérodrome de Lessay</br>30 Route de l'aérodrome</br>50430 Lessay",
|
||||
"website": "www.aair-parachutisme.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.75120",
|
||||
"longitude": "-3.46701",
|
||||
"name": "Lannion - Septième Ciel Parachutisme",
|
||||
"address": "126 rue de l'aérodrome</br>Pégase sud</br>22300 Lannion",
|
||||
"website": "www.septiemeciel-parachutisme.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.53198",
|
||||
"longitude": "0.09323",
|
||||
"name": "Le Havre - Abeille Parachutisme",
|
||||
"address": "Aéroport du Havre/Octeville</br>76620 Le Havre",
|
||||
"website": "www.abeilleparachutisme.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.62535",
|
||||
"longitude": "1.08696",
|
||||
"name": "Le Blanc - EFP Le Blanc",
|
||||
"address": "Aérodrome - 36300 Le Blanc",
|
||||
"website": "www.efpleblanc.com",
|
||||
"email": "info@efpleblanc.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.69947",
|
||||
"longitude": "-1.37625",
|
||||
"name": "La Roche sur Yon - Vendée Chute Libre",
|
||||
"address": "Aérodrome René Couzinet</br>85000 La Roche-sur-Yon",
|
||||
"website": "www.vendee-chutelibre.com",
|
||||
"email": "vendeechutelibre@orange.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.36632",
|
||||
"longitude": "5.32725",
|
||||
"name": "Grenoble - CEP Grenoble",
|
||||
"address": "Aérodrome de Grenoble Alpes Isère</br>38590 - St Etienne de St Geoirs",
|
||||
"website": "www.parachutisme38.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.05227",
|
||||
"longitude": "-3.66317",
|
||||
"name": "Guiscriff - EPBA",
|
||||
"address": "Aérodrome Bretagne-Atlantique de Scaebr-Guiscriff Pont Person</br>56560 Guiscriff",
|
||||
"website": "epba-parachutisme.sportsregions.fr",
|
||||
"email": "epbaguiscriff@gmail.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.56609",
|
||||
"longitude": "-0.05352",
|
||||
"name": "La Réole - Espace Chute Libre",
|
||||
"address": "Aérodrome de La Réole - 33190",
|
||||
"website": "www.parachute-gironde.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.66560",
|
||||
"longitude": "2.96916",
|
||||
"name": "Frétoy le Château - Skydive Frétoy",
|
||||
"address": "Aérodrome</br>Le Bois de Ham</br>60640 Frêtoy le château",
|
||||
"website": "www.skydivefretoy.com",
|
||||
"email": "contact@skydivefretoy.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "49.88459",
|
||||
"longitude": "1.08747",
|
||||
"name": "Dieppe - Air Libre Parachutisme",
|
||||
"address": "Aérodrome de Dieppe</br>76550 St Aubin sur Scie",
|
||||
"website": "www.airlibre-parachutisme.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "45.63283",
|
||||
"longitude": "5.88416",
|
||||
"name": "Chambéry - EP de Savoie",
|
||||
"address": "Aéroport de Chambéry</br>73420 Le Viviers du Lac",
|
||||
"website": "www.savoieparachutisme.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.82828",
|
||||
"longitude": "4.82631",
|
||||
"name": "Châlon sur Sâone - Parachutisme 71",
|
||||
"address": "Aérodrome de Champforgeuil</br>71530 Châlon sur Sâone",
|
||||
"website": "www.parachutisme71.com",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.34905",
|
||||
"longitude": "1.47618",
|
||||
"name": "Cahors - CEP de Cahors",
|
||||
"address": "Aérodrome Cahors Lalbenque</br>46230 Cieurac",
|
||||
"website": "www.parachutisme.com",
|
||||
"email": "cep46@wanadoo.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.27794",
|
||||
"longitude": "0.51819",
|
||||
"name": "Castelnau Magnoac - Air 65",
|
||||
"address": "5 chemin de l'aérodrome</br>65230 Castelnau-Magnoac",
|
||||
"website": "www.air65-parachutisme.fr",
|
||||
"email": "infos@air65.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.30560",
|
||||
"longitude": "1.08067",
|
||||
"name": "Bouloc - EP Midi-Pyrénées",
|
||||
"address": "Aérodrome Cardenal</br>82110 Bouloc",
|
||||
"website": "www.bouloc-skydive.com",
|
||||
"email": "accueil@bouloc-skydive.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.68738",
|
||||
"longitude": "3.08163",
|
||||
"name": "Bondues - EFP Lille Bondues",
|
||||
"address": "98 Parc de l'aérodrome</br>59910 Bondues",
|
||||
"website": "www.parachutisme-lille.fr",
|
||||
"email": "contact@parachutisme-lille.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "47.20555",
|
||||
"longitude": "6.07627",
|
||||
"name": "Besançon - EP de Besançon Franche Comté",
|
||||
"address": "Route de l'aérodrome</br>25660 La Vèze",
|
||||
"email": "para.besac@wanadoo.fr",
|
||||
"website": "www.parabesancon.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.59828",
|
||||
"longitude": "-1.11564",
|
||||
"name": "Arcachon - Arcachon Parachutisme",
|
||||
"address": "Aérodrome Villemarie</br>33260 La Teste de Buch",
|
||||
"website": "www.arcachon-parachutisme.fr",
|
||||
"email": "info@arcachon-parachutisme.fr",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "46.19398",
|
||||
"longitude": "6.26921",
|
||||
"name": "Annemasse - Parachutisme 74",
|
||||
"address": "Aérodrome d'Annemasse - 74100 Annemasse",
|
||||
"website": "www.parachutisme74.com",
|
||||
"email": "info@parachutisme74.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.89582",
|
||||
"longitude": "2.38941",
|
||||
"name": "Paris - iFLY Paris",
|
||||
"address": "La Villette</br>30 avenue Corentin Cariou</br>75019 Paris",
|
||||
"website": "www.iflyfrance.com",
|
||||
"email": "info.paris@iflyworld.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.45828",
|
||||
"longitude": "6.03739",
|
||||
"name": "Gap - Skydive Center",
|
||||
"address": "Aérodrome de Gap Tallard</br>05130 Tallard",
|
||||
"website": "www.skydivecenter.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.45843",
|
||||
"longitude": "6.03631",
|
||||
"name": "Gap - On'Air",
|
||||
"address": "Aérodrome de Gap-Tallard</br>05130 Tallard",
|
||||
"website": "www.onairtunnel.com",
|
||||
"email": "contact@onairtunnel.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "48.9569381",
|
||||
"longitude": "2.2048741",
|
||||
"name": "Argenteuil - Aerokart",
|
||||
"address": "199/203 Route de Pontoise</br>95100 Argenteuil",
|
||||
"website": "www.aerokart.com",
|
||||
"email": "planning@aerokart.com",
|
||||
"type": [
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.17301",
|
||||
"longitude": "2.73667",
|
||||
"name": "Lézignan Corbières - Flyzone",
|
||||
"address": "Aérodrome de Lézignan-Corbières - 11200",
|
||||
"website": "www.flyzone.fr",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz",
|
||||
"tunnel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "43.38849",
|
||||
"longitude": "6.37716",
|
||||
"name": "Le Luc - C.E.P. Côte d'Azur",
|
||||
"address": "83340 Le Cannet des Maures",
|
||||
"website": "www.skydivecepca.com",
|
||||
"email": "cepcaleluc@gmail.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "50.95764",
|
||||
"longitude": "1.95463",
|
||||
"name": "Calais - Para Groupe Jean Bart",
|
||||
"address": "Rue Zamenhoff</br>59240 Dunkerque",
|
||||
"website": "www.parachutisme-nord.com",
|
||||
"email": "resa@parachutisme-nord.com",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"latitude": "44.17662",
|
||||
"longitude": "0.58971",
|
||||
"name": "Agen - E.P. Agen",
|
||||
"address": "Aérodrome Agen la Garenne</br>47520 Le Passage",
|
||||
"website": "www.agen-parachutisme.org",
|
||||
"email": "",
|
||||
"type": [
|
||||
"dz"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1,12 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Javelin",
|
||||
"manufacturer": "Sun Path",
|
||||
"minSize": 120,
|
||||
"maxSize": 135,
|
||||
"AAD": "Cypress 2",
|
||||
"mainCanopy": "Pilot 150",
|
||||
"reserveCanopy": "Techno 128"
|
||||
}
|
||||
]
|
||||
@@ -1,13 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"jumpTypeId" : 1,
|
||||
"aircraftId" : 1,
|
||||
"dropZoneId" : 1,
|
||||
"gearId" : 1,
|
||||
"exitAltitude" : "4000",
|
||||
"deployAltitude" : "1500",
|
||||
"withCutaway" : false,
|
||||
"notes" : ""
|
||||
}
|
||||
]
|
||||
@@ -1,46 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": "PAC"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "RW 4"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "RW 8"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "RW X"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "FreeFly"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "FreeStyle"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Canopy"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Track/Trace"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Wingsuit 1"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Wingsuit 2"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Wingsuit 3"
|
||||
}
|
||||
]
|
||||
@@ -1,12 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using LiteDB;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
public class DropZoneRepository : IDropZoneRepository
|
||||
@@ -15,24 +15,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
IEnumerable<DropZone> result = new List<DropZone>();
|
||||
|
||||
//using (StreamReader file = File.OpenText(@"Data/DropZone.json"))
|
||||
//using (JsonTextReader reader = new JsonTextReader(file))
|
||||
//{
|
||||
// var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
// result = jsonResult.ToObject<IEnumerable<DropZone>>();
|
||||
//}
|
||||
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
// Get a collection (or create, if doesn't exist)
|
||||
var col = db.GetCollection<DropZone>("DropZone");
|
||||
|
||||
result = col.FindAll().ToList();
|
||||
//foreach (var item in result)
|
||||
//{
|
||||
// item.Id = 0;
|
||||
// col.Insert(item);
|
||||
//}
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -42,12 +29,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
DropZone result;
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/DropZone.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
var tmp = jsonResult.ToObject<IEnumerable<DropZone>>();
|
||||
result = tmp.SingleOrDefault(t => t.Id == id);
|
||||
var col = db.GetCollection<DropZone>("DropZone");
|
||||
|
||||
result = col.FindById(new BsonValue(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1,11 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using LiteDB;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
public class GearRepository : IGearRepository
|
||||
{
|
||||
public IEnumerable<Gear> GetAllGears()
|
||||
{
|
||||
IEnumerable<Gear> result = new List<Gear>();
|
||||
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var col = db.GetCollection<Gear>("Gear");
|
||||
|
||||
result = col.FindAll().ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public Gear GetGearById(int id)
|
||||
{
|
||||
Gear result;
|
||||
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var col = db.GetCollection<Gear>("Gear");
|
||||
|
||||
result = col.FindById(new BsonValue(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using LiteDB;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
@@ -14,11 +15,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
IEnumerable<Jump> result = new List<Jump>();
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/Jump.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
result = jsonResult.ToObject<IEnumerable<Jump>>();
|
||||
var col = db.GetCollection<Jump>("Jump");
|
||||
|
||||
result = col.FindAll().ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -28,12 +29,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
Jump result;
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/Jump.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
var tmp = jsonResult.ToObject<IEnumerable<Jump>>();
|
||||
result = tmp.SingleOrDefault(t => t.Id == id);
|
||||
var col = db.GetCollection<Jump>("Jump");
|
||||
|
||||
result = col.FindById(new BsonValue(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -42,22 +42,15 @@ namespace skydiveLogs_api.Data
|
||||
public bool AddJump(Jump newJump)
|
||||
{
|
||||
var result = true;
|
||||
List<Jump> jumpList;
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader file = File.OpenText(@"Data/Jump.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
jumpList = jsonResult.ToObject<List<Jump>>();
|
||||
var col = db.GetCollection<Jump>("Jump");
|
||||
|
||||
col.Insert(newJump);
|
||||
}
|
||||
|
||||
newJump.Id = jumpList.Count() + 1;
|
||||
jumpList.Add(newJump);
|
||||
|
||||
string outputJson = JsonConvert.SerializeObject(jumpList);
|
||||
File.WriteAllText(@"Data/Jump.json", outputJson);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using LiteDB;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
@@ -16,11 +15,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
IEnumerable<JumpType> result = new List<JumpType>();
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/JumpType.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
result = jsonResult.ToObject<IEnumerable<JumpType>>();
|
||||
var col = db.GetCollection<JumpType>("JumpType");
|
||||
|
||||
result = col.FindAll().ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -30,12 +29,11 @@ namespace skydiveLogs_api.Data
|
||||
{
|
||||
JumpType result;
|
||||
|
||||
using (StreamReader file = File.OpenText(@"Data/JumpType.json"))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
using (var db = new LiteDatabase(@".\Data\MyData.db"))
|
||||
{
|
||||
var jsonResult = (JArray)JToken.ReadFrom(reader);
|
||||
var tmp = jsonResult.ToObject<IEnumerable<JumpType>>();
|
||||
result = tmp.SingleOrDefault(t => t.Id == id);
|
||||
var col = db.GetCollection<JumpType>("JumpType");
|
||||
|
||||
result = col.FindById(new BsonValue(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -5,32 +5,6 @@
|
||||
<RootNamespace>skydiveLogs_api.Data</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Data\Aircraft.json" />
|
||||
<None Remove="Data\DropZone.json" />
|
||||
<None Remove="Data\Gear.json" />
|
||||
<None Remove="Data\Jump.json" />
|
||||
<None Remove="Data\JumpType.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Data\Aircraft.json">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="Data\DropZone.json">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="Data\Gear.json">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="Data\Jump.json">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="Data\JumpType.json">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LiteDB" Version="5.0.0-beta" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user