AuthorizeRequest.cs 823 B

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