CancelReservationRequest.cs 825 B

123456789101112131415161718192021222324252627282930313233343536
  1. using EVCB_OCPP.Packet.Features;
  2. using Newtonsoft.Json;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace EVCB_OCPP.Packet.Messages.Reservation
  10. {
  11. public class CancelReservationRequest : IRequest
  12. {
  13. public CancelReservationRequest()
  14. {
  15. Action = Actions.CancelReservation.ToString();
  16. }
  17. [JsonIgnore]
  18. public string Action { set; get; }
  19. [Required]
  20. public int reservationId { set; get; }
  21. public bool TransactionRelated()
  22. {
  23. return false;
  24. }
  25. public bool Validate()
  26. {
  27. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  28. }
  29. }
  30. }