Exemple #1
0
        public object Put(EnterMatchAppointmentRequest request)
        {
            var match = this.Db.LoadSingleById <Match>(request.Id);

            match.Throw404NotFoundIfNull("Match not found");

            this.EnsureUserMayEnterMatchAppointment(match);

            var universalTime = request.PlayDate.Value.ToUniversalTime();

            this.Db.Update <Match>(new { request.TableId, PlayDate = universalTime, RegisterDate = DateTime.UtcNow }, p => p.Id == request.Id);

            var dto = this.Get(new GetMatchByIdRequest {
                Id = request.Id
            });

            return(dto);
        }
Exemple #2
0
 /// <summary>
 /// Ensures the authenticated user is either involved in the match or has the admin role.
 /// </summary>
 public static void EnterMatchAppointment(IRequest request, IResponse response,
                                          EnterMatchAppointmentRequest arg3)
 {
     // TODO: move the code from the services to here
 }