Supported data types

Supported are all primative data types, which includes

  1. String
  2. Int16
  3. Int32
  4. Int64
  5. Boolean
  6. Byte
  7. Char
  8. Decimal
  9. Double
  10. Single
  11. UInt16
  12. UInt32
  13. UInt64

Enums will be automatically mapped to an UInt32. In advance you can ship those types as

  1. Standalone
  2. As an array
  3. As a list
        public int Standalone { get; set; }

        public int[] Array { get; set; }

        public List<int> List { get; set; }

Classes

You can also send and receive “custom” classes, as long as they contain only primative data types. Properties are allowed to be “NULL”.

    public class AddStudentToDatabaseRequest : RequestPacket
    {
        public AddStudentToDatabaseRequest()
        {

        }

        public AddStudentToDatabaseRequest(Student student)
        {
            Student = student;
        }

        public Student Student { get; set; }

        public List<string> Rooms { get; set; }
    }
    public class Student
    {
        public string FirstName { get; set; }

        public string Lastname { get; set; }

        [PacketIgnoreProperty]
        public string FullName { get { return FirstName + " " + Lastname; } }
        
        public Date Birthday { get; set; }

        public List<GeoCoordinate> VisitedPlaces { get; set; } = new List<GeoCoordinate>();
    }
    public class Date
    {
        public int Day { get; set; }

        public int Month { get; set; }

        public int Year { get; set; }

        [PacketIgnoreProperty]
        public DateTime DateTime { get { return new DateTime(Year, Month, Day); } }
    }
    public class GeoCoordinate
    {
        public float Longitude { get; set; }

        public float Latitude { get; set; }
    }

 

Hinterlasse einen Kommentar

Please Login to comment
  Subscribe  
Notify of