Beispiel #1
0
        public static Entity ToDomain(EntityDTO entity)
        {
            return(new Entity()
            {
                UserId = entity.UserId,
                EntityId = entity.Id,
                IsApproved = entity.IsApproved,
                EntityName = entity.EntityName,
                EntityResponsableName = entity.EntityResponsableName,
                Email = entity.Email,
                EntityPhone = entity.EntityPhone,
                Password = entity.Password,
                EntityReferencePoint = entity.EntityReferencePoint,
                EntityAffinity = AffinityAdapter.ListToDomain(entity.EntityAffinity),
                EntityInitials = entity.EntityInitials,
                EntityCreationDate = entity.EntityCreationDate,
                EntitySocialNetwork = entity.EntitySocialNetwork,
                EntityWebSite = entity.EntityWebSite,
                EntityDescription = entity.EntityDescription,

                EntityAddress = new Address()
                {
                    AddressId = entity.EntityAddress.AddressId,
                    CEP = entity.EntityAddress.CEP,
                    Avenue = entity.EntityAddress.Avenue,
                    Number = entity.EntityAddress.Number,
                    Neighborhood = entity.EntityAddress.Neighborhood,
                    City = entity.EntityAddress.City,
                    State = entity.EntityAddress.State
                }
            });
        }
Beispiel #2
0
 public static Voluntary ToDomain(VoluntaryDTO voluntary)
 {
     return(new Voluntary()
     {
         VoluntaryId = voluntary.VoluntaryId,
         UserId = voluntary.UserId,
         IsApproved = voluntary.IsApproved,
         Name = voluntary.Name,
         Email = voluntary.Email,
         Phone = voluntary.Phone,
         Password = voluntary.Password,
         SocialNetwork = voluntary.SocialNetwork,
         Affinities = AffinityAdapter.ListToDomain(voluntary.Affinities),
         Address = new Address()
         {
             AddressId = voluntary.Address.AddressId,
             CEP = voluntary.Address.CEP,
             Avenue = voluntary.Address.Avenue,
             Number = voluntary.Address.Number,
             Neighborhood = voluntary.Address.Neighborhood,
             City = voluntary.Address.City,
             State = voluntary.Address.State
         }
     });
 }
 public static Event ToDomain(EventDTO sEvent)
 {
     return(new Event()
     {
         EventId = sEvent.EventId,
         Title = sEvent.Title,
         Description = sEvent.Description,
         Date = sEvent.Date,
         Affinities = AffinityAdapter.ListToDomain(sEvent.Affinities),
         Address = new Address()
         {
             AddressId = sEvent.Address.AddressId,
             CEP = sEvent.Address.CEP,
             Avenue = sEvent.Address.Avenue,
             Number = sEvent.Address.Number,
             Neighborhood = sEvent.Address.Neighborhood,
             City = sEvent.Address.City,
             State = sEvent.Address.State
         }
     });
 }
Beispiel #4
0
        public static Donation ToDomain(DonationDTO donationDTO)
        {
            return(new Donation()
            {
                DonationId = donationDTO.DonationId,
                UserId = donationDTO.UserId,
                Title = donationDTO.Title,
                Description = donationDTO.Description,
                Quantity = donationDTO.Quantity,
                TakeDonation = donationDTO.TakeDonation,
                Affinities = AffinityAdapter.ListToDomain(donationDTO.Affinities),

                Address = new Address()
                {
                    AddressId = donationDTO.Address.AddressId,
                    CEP = donationDTO.Address.CEP,
                    Avenue = donationDTO.Address.Avenue,
                    Number = donationDTO.Address.Number,
                    Neighborhood = donationDTO.Address.Neighborhood,
                    City = donationDTO.Address.City,
                    State = donationDTO.Address.State
                }
            });
        }