blob: 741b2f0e868e88fd53b87ccb65641634b27b5964 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
using System;
using System.Collections.Generic;
using System.Text;
using Tango.BLL.Objects;
using Tango.DAL.Entities;
namespace Tango.BLL.Mappers
{
public class OrganizationToOrganizationEntityMapper : IMapper<Organization, OrganizationEntity>
{
public void Map(Organization source, OrganizationEntity target)
{
target.ID = source.ID;
new AddressToAddressModelMapper().Map(source.Address, target.Address);
new ContactToContactModelMapper().Map(source.Contact, target.Contact);
}
public void Map(OrganizationEntity source, Organization target)
{
target.ID = source.ID;
new AddressToAddressModelMapper().Map(source.Address, target.Address);
new ContactToContactModelMapper().Map(source.Contact, target.Contact);
}
public OrganizationEntity Create(Organization source)
{
OrganizationEntity entity = new OrganizationEntity();
Map(source, entity);
return entity;
}
public Organization Create(OrganizationEntity source)
{
Organization organization = new Organization();
Map(source, organization);
return organization;
}
}
}
|