Skip to content

Latest commit

 

History

History
253 lines (220 loc) · 7.4 KB

File metadata and controls

253 lines (220 loc) · 7.4 KB

Person

Generally

Property Value
Description An simplified person with an firstname, lastname, birthday and some other optional properties.
Namespace DoofesZeug.Entities.Specieses.Human
BaseClass Species
SourceCode Person.cs

Properties

Declared

Name Type Read Write DefaultValue
FirstName FirstName NULL
LastName LastName NULL
Handedness Handedness? NULL
BloodGroup BloodGroup? NULL
HairColor WellKnownHairColor? NULL
Religion MajorReligion? NULL
Profession WellKnownProfession? NULL
DriverLicense EuropeanDriverLicense? NULL
AverageHeight Centimeter NULL
AverageWeight Kilogram NULL
Phone Phone NULL
Homepage Homepage NULL
EMailAddress EMailAddress NULL
BMI Double? NULL

Inherited

Name Type Read Write DefaultValue
DateOfBirth DateOfBirth NULL
Gender Gender? NULL
DateOfDeath DateOfDeath NULL
Age UInt32? NULL
IsAlive Boolean False
Id Guid Guid.NewGuid()

UML Diagram

Person.png


Code Example

using System;

using DoofesZeug.Entities.ManMade.Communication;
using DoofesZeug.Entities.Specieses;
using DoofesZeug.Entities.Specieses.Human;
using DoofesZeug.Extensions;



namespace DoofesZeug.Examples.Entities
{
    public static class PersonExample
    {
        public static void CreatePerson()
        {
            Person p = new Person
            {
                FirstName = "John",
                LastName = "Doe",
                Gender = Gender.Male,

                DateOfBirth = (11, 02, 1942),
                DateOfDeath = (22, 03, 1942 + 42),

                Handedness = Handedness.Left,
                BloodGroup = BloodGroup.AB,
                HairColor = WellKnownHairColor.Blond,
                Religion = MajorReligion.Buddhism,
                Profession = WellKnownProfession.Engineer,
                DriverLicense = EuropeanDriverLicense.B | EuropeanDriverLicense.AM,

                AverageHeight = 174,
                AverageWeight = 72,

                Phone = new Phone
                {
                    Number = "+49 54321 424269",
                    PhoneType = PhoneType.Landline,
                    InformationType = InformationType.Private
                },
                EMailAddress = new EMailAddress
                {
                    Address = "[email protected]",
                    InformationType = InformationType.Business
                },
                Homepage = new Homepage
                {
                    Url = new("https://github.com/ObiWanLansi"),
                    InformationType = InformationType.Business
                }
            };

            Console.Out.WriteLineAsync(p.ToStringTable());
        }
    }
}

Console Example

┌───────────────┬──────────────────────────────────────┐
│ Property      │ Value                                │
├───────────────┼──────────────────────────────────────┤
│ FirstName     │ John                                 │
│ LastName      │ Doe                                  │
│ Handedness    │ Left                                 │
│ BloodGroup    │ AB                                   │
│ HairColor     │ Blond                                │
│ Religion      │ Buddhism                             │
│ Profession    │ Engineer                             │
│ DriverLicense │ AM, B                                │
│ AverageHeight │ 174 cm                               │
│ AverageWeight │ 72 kg                                │
│ Phone         │ +49 54321 424269                     │
│ Homepage      │ https://github.com/ObiWanLansi       │
│ EMailAddress  │ [email protected]
│ BMI           │ 23,781211853027344                   │
│ DateOfBirth   │ 11.02.1942                           │
│ Gender        │ Male                                 │
│ DateOfDeath   │ 22.03.1984                           │
│ Age           │ 42                                   │
│ IsAlive       │ False                                │
│ Id            │ bd1b8530-ea2c-4561-b4cc-01db3bb8d7d3 │
└───────────────┴──────────────────────────────────────┘

JSON Example

{
  "FirstName": "John",
  "LastName": "Doe",
  "Handedness": "Left",
  "BloodGroup": "AB",
  "HairColor": "Blond",
  "Religion": "Buddhism",
  "Profession": "Engineer",
  "DriverLicense": "AM, B",
  "AverageHeight": {
    "Prefix": "Centi",
    "Unit": "m",
    "Value": 174.0
  },
  "AverageWeight": {
    "Prefix": "Kilo",
    "Unit": "g",
    "Value": 72.0
  },
  "Phone": {
    "Number": "+49 54321 424269",
    "PhoneType": "Landline",
    "InformationType": "Private"
  },
  "Homepage": {
    "Url": "https://github.com/ObiWanLansi",
    "InformationType": "Business"
  },
  "EMailAddress": {
    "Address": "[email protected]",
    "InformationType": "Business"
  },
  "BMI": 23.781211853027344,
  "DateOfBirth": "11.02.1942",
  "Gender": "Male",
  "DateOfDeath": "22.03.1984",
  "Age": 42,
  "IsAlive": false,
  "Id": "bd1b8530-ea2c-4561-b4cc-01db3bb8d7d3"
}

YAML Example

FirstName:
  Value: John
LastName:
  Value: Doe
Handedness: Left
BloodGroup: AB
HairColor: Blond
Religion: Buddhism
Profession: Engineer
DriverLicense: AM, B
AverageHeight:
  Prefix:
    Name: Centi
    Symbol: c
    Factor: 0.01
  Unit: m
  Value: 174
AverageWeight:
  Prefix:
    Name: Kilo
    Symbol: k
    Factor: 1000
  Unit: g
  Value: 72
Phone:
  Number: +49 54321 424269
  PhoneType: Landline
  InformationType: Private
Homepage:
  Url: https://github.com/ObiWanLansi
  InformationType: Business
EMailAddress:
  Address: [email protected]
  InformationType: Business
BMI: 23.781211853027344
DateOfBirth:
  Day:
    Value: 11
  Month:
    Value: 2
  Year:
    Value: 1942
Gender: Male
DateOfDeath:
  Day:
    Value: 22
  Month:
    Value: 3
  Year:
    Value: 1984
Age: 42
IsAlive: false
Id: bd1b8530-ea2c-4561-b4cc-01db3bb8d7d3