Ejemplo n.º 1
0
 public Task <RiderSessionResult> AddRiderSessionResult(RiderSessionResult riderSessionResult, Session session, Rider rider)
 {
     if (riderSessionResult.RiderSessionResultId == Guid.Empty)
     {
         riderSessionResult.RiderSessionResultId = Guid.NewGuid();
     }
     riderSessionResult.SessionId   = session?.SessionId;
     riderSessionResult.RiderId     = rider?.RiderId;
     riderSessionResult.RiderName   = rider?.Name;
     riderSessionResult.RiderNumber = rider?.Number;
     repo.Insert(riderSessionResult);
     return(Task.FromResult(riderSessionResult));
 }
Ejemplo n.º 2
0
        public async Task <RiderSessionResult> AddRiderSessionResult(RiderSessionResult riderSessionResult, Session session, Rider rider)
        {
            if (riderSessionResult.RiderSessionResultId == Guid.Empty)
            {
                riderSessionResult.RiderSessionResultId = Guid.NewGuid();
            }
            riderSessionResult.SessionId   = session?.SessionId;
            riderSessionResult.RiderId     = rider?.RiderId;
            riderSessionResult.RiderName   = rider?.Name;
            riderSessionResult.RiderNumber = rider?.Number;
            await Db.GetCollection <RiderSessionResult>(nameof(RiderSessionResult)).InsertOneAsync(riderSessionResult);

            return(riderSessionResult);
        }
        public async Task <RiderSessionResult> AddRiderSessionResult(RiderSessionResult riderSessionResult, Session session, Rider rider)
        {
            if (riderSessionResult.RiderSessionResultId == Guid.Empty)
            {
                riderSessionResult.RiderSessionResultId = Guid.NewGuid();
            }
            riderSessionResult.SessionId   = session?.SessionId;
            riderSessionResult.RiderId     = rider?.RiderId;
            riderSessionResult.RiderName   = rider?.Name;
            riderSessionResult.RiderNumber = rider?.Number;
            ctx.RiderSessionResults.Add(riderSessionResult);
            await ctx.SaveChangesAsync();

            return(riderSessionResult);
        }