Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the WideWorld class.
        /// </summary>
        public WideWorld()
            : base(int.MaxValue)
        {
            Transfer(this).To(this); // This item is its own container (insert obscure set-theoretic reference here)

            // The world comes with a pack of semi-feral pomeranians by default
            for (int i = 0; i < DefaultNumberOfDogs; i++)
            {
                Dog wildDog = new Dog();
                Transfer(wildDog).To(this);
            }
        }
Ejemplo n.º 2
0
        public static externalDTO.Dog MapFromDomain(internalDTO.Dog dog)
        {
            var res = dog == null ? null : new externalDTO.Dog
            {
                Id          = dog.Id,
                DogName     = dog.DogName,
                DateOfBirth = dog.DateOfBirth,
                DateOfDeath = dog.DateOfDeath,
                Sex         = dog.Sex.Translate(),
                BreedId     = dog.BreedId,
                Breed       = BreedMapper.MapFromDomain(dog.Breed),
                Owner       = dog.Owner,
                AppUserId   = dog.AppUserId,
            };

            return(res);
        }