Exemplo n.º 1
0
        internal static models.Client MapClientToModel(this entities.Client e)
        {
            var m = new models.Client
            {
                Addresses  = e.Addresses.Select(x => x.MapAddressToModel()).ToList(),
                Age        = e.Age,
                Emails     = e.Emails,
                Gender     = e.Gender,
                ID         = e.ID,
                Joined     = e.Joined,
                LastName   = e.LastName,
                Name       = e.Name,
                Telephones = e.Telephones.Select(x => x.MapTelephoneToModel()).ToList()
            };

            return(m);
        }
Exemplo n.º 2
0
        internal static entities.Client MapClientToEntity(this models.Client m)
        {
            var e = new entities.Client
            {
                Addresses  = m.Addresses.Select(x => x.MapAddressToEntity()).ToList(),
                Age        = m.Age,
                Emails     = m.Emails,
                Gender     = m.Gender,
                Joined     = m.Joined,
                LastName   = m.LastName,
                Name       = m.Name,
                Telephones = m.Telephones.Select(x => x.MapTelephoneToEntity()).ToList()
            };

            if (!string.IsNullOrWhiteSpace(m.ID))
            {
                e.ID = m.ID;
            }

            return(e);
        }