Beispiel #1
0
        public Lap CreateLap(Stint stint, int lap)
        {
            ValidateStint(stint);

            Task <List <Lap> > task = ObjectManager.Connection.QueryAsync <Lap>(
                @"
                    Select * From Laps Where StintID = ? And Nr = ?
                ", stint.ID, lap);

            if (task.Result.Count == 0)
            {
                Lap theLap = new Lap {
                    SessionID = stint.Session.ID, StintID = stint.ID, Nr = lap
                };

                theLap.Save();

                return(theLap);
            }
            else
            {
                return(task.Result[0]);
            }
        }