Example #1
0
        public static Habitant CreateFromCommand(int id, Commands.Dto.Habitant habitantCommand)
        {
            var habitant = new Habitant(new HabitantId(id))
            {
                Name        = HabitantName.FromString(habitantCommand.Name),
                Thumbnail   = new System.Uri(habitantCommand.Thumbnail),
                Age         = habitantCommand.Age,
                Weight      = habitantCommand.Weight,
                Height      = habitantCommand.Height,
                HairColor   = new HairColor(new HairColorId(habitantCommand.HairColor)),
                Professions = habitantCommand.Professions
                              .Select(p => new Profession(new ProfessionId(p))).ToList(),
                Friends = new List <HabitantName>()
            };

            return(habitant);
        }
Example #2
0
 public static Habitant CreateFromCommand(Commands.Dto.Habitant habitantCommand)
 {
     return(CreateFromCommand(HabitantId.NullHabitantId, habitantCommand));
 }