Skip to content

Commit 14ece38

Browse files
Added further base classes
Fixed #453
1 parent a662478 commit 14ece38

7 files changed

Lines changed: 126 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace AndreasReitberger.Shared.Core.Enums
2+
{
3+
public enum ContactType
4+
{
5+
Phone,
6+
Mobile,
7+
Email,
8+
Fax,
9+
}
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace AndreasReitberger.Shared.Core.Interfaces
2+
{
3+
public interface IAddress
4+
{
5+
#region Properties
6+
7+
public string Street { get; set; }
8+
public string HouseNumber { get; set; }
9+
public string ZipCode { get; set; }
10+
public string City { get; set; }
11+
public string State { get; set; }
12+
public string Country { get; set; }
13+
14+
#endregion
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using AndreasReitberger.Shared.Core.Enums;
2+
3+
namespace AndreasReitberger.Shared.Core.Interfaces
4+
{
5+
public interface IContactDetail
6+
{
7+
#region Properties
8+
9+
public ContactType Type { get; set; }
10+
public string Value { get; set; }
11+
12+
#endregion
13+
}
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace AndreasReitberger.Shared.Core.Interfaces
2+
{
3+
public interface IPerson
4+
{
5+
#region Properties
6+
7+
public string Salutation { get; set; }
8+
public string FirstName { get; set; }
9+
public string LastName { get; set; }
10+
public IAddress? Address { get; set; }
11+
public ICollection<IContactDetail> ContactDetails { get; set; }
12+
13+
#endregion
14+
}
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using AndreasReitberger.Shared.Core.Interfaces;
3+
4+
namespace AndreasReitberger.Shared.Core.Models.Adress
5+
{
6+
public partial class Address : ObservableObject, IAddress
7+
{
8+
#region Properties
9+
[ObservableProperty]
10+
public partial string Street { get; set; }
11+
12+
[ObservableProperty]
13+
public partial string HouseNumber { get; set; } = string.Empty;
14+
15+
[ObservableProperty]
16+
public partial string ZipCode { get; set; } = string.Empty;
17+
18+
[ObservableProperty]
19+
public partial string City { get; set; } = string.Empty;
20+
21+
[ObservableProperty]
22+
public partial string State { get; set; } = string.Empty;
23+
24+
[ObservableProperty]
25+
public partial string Country { get; set; } = string.Empty;
26+
#endregion
27+
}
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using AndreasReitberger.Shared.Core.Enums;
2+
using AndreasReitberger.Shared.Core.Interfaces;
3+
using CommunityToolkit.Mvvm.ComponentModel;
4+
5+
namespace AndreasReitberger.Shared.Core.Person
6+
{
7+
public partial class ContactDetail : ObservableObject, IContactDetail
8+
{
9+
#region Properties
10+
11+
[ObservableProperty]
12+
public partial ContactType Type { get; set; }
13+
14+
[ObservableProperty]
15+
public partial string Value { get; set; } = string.Empty;
16+
#endregion
17+
}
18+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using AndreasReitberger.Shared.Core.Interfaces;
2+
using CommunityToolkit.Mvvm.ComponentModel;
3+
4+
namespace AndreasReitberger.Shared.Core.Person
5+
{
6+
public partial class Person : ObservableObject, IPerson
7+
{
8+
#region Properties
9+
[ObservableProperty]
10+
public partial string Salutation { get; set; } = string.Empty;
11+
12+
[ObservableProperty]
13+
public partial string FirstName { get; set; } = string.Empty;
14+
15+
[ObservableProperty]
16+
public partial string LastName { get; set; } = string.Empty;
17+
18+
[ObservableProperty]
19+
public partial IAddress? Address { get; set; }
20+
21+
[ObservableProperty]
22+
public partial ICollection<IContactDetail> ContactDetails { get; set; } = [];
23+
#endregion
24+
}
25+
}

0 commit comments

Comments
 (0)