https://github.com/folkerkinzel/contacts
.NET library that provides an easy to use data model to store contact data of organizations and natural persons.
https://github.com/folkerkinzel/contacts
contact csharp data-model dotnet
Last synced: 3 months ago
JSON representation
.NET library that provides an easy to use data model to store contact data of organizations and natural persons.
- Host: GitHub
- URL: https://github.com/folkerkinzel/contacts
- Owner: FolkerKinzel
- License: mit
- Created: 2020-03-20T13:42:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-27T22:59:33.000Z (5 months ago)
- Last Synced: 2025-02-26T02:36:37.906Z (3 months ago)
- Topics: contact, csharp, data-model, dotnet
- Language: C#
- Homepage:
- Size: 7.37 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FolkerKinzel.Contacts
[](https://www.nuget.org/packages/FolkerKinzel.Contacts/)
[](https://github.com/FolkerKinzel/Contacts/blob/master/LICENSE).NET library that provides an easy to use data model to store contact data of organizations and natural persons.
(If you need to persist this data model as vCard (*.vcf) or CSV, have a look at [FolkerKinzel.Contacts.IO](https://github.com/FolkerKinzel/Contacts.IO).)
[Project Reference](https://folkerkinzel.github.io/Contacts/reference/)
[Version History](https://github.com/FolkerKinzel/Contacts/releases)
## Example
```csharp
using FolkerKinzel.Contacts;namespace Examples;
public static class ContactExample
{
public static Contact[] InitializeContacts() =>
[
new()
{
DisplayName = "John Doe",
Person = new Person
{
Name = new Name
{
FirstName = "John",
MiddleName = "William",
LastName = "Doe",
Suffix = "jr."
},BirthDay = new DateOnly(1972, 1, 3),
Spouse = "Jane Doe",
Anniversary = new DateOnly(2001, 6, 15),
Gender = Sex.Male,
NickName = "The Dude"
},Work = new Work
{
JobTitle = "Facility Manager",
Company = "Does Company"
},// PhoneNumber implements IEnumerable. So you
// can assign a single instance without having to wrap it
// into an Array or List:
PhoneNumbers = new PhoneNumber
{
Value = "0123-45678",
IsWork = true
},EmailAddresses = ["[email protected]"]
},new()
{
DisplayName = "Jane Doe",
Person = new Person
{
Name = new Name
{
FirstName = "Jane",
LastName = "Doe",
Prefix = "Dr."
},
BirthDay = new DateOnly(1981, 5, 4),
Spouse = "John Doe",
Anniversary = new DateOnly(2001, 6, 15),
Gender = Sex.Female
},Work = new Work
{
JobTitle = "CEO",
Company = "Does Company"
},PhoneNumbers =
[
new() {
Value = "0123-45678",
IsWork = true
},new() {
Value = "876-54321",
IsMobile = true
}
]
}
];
}
```