Exemplo n.º 1
0
        public static void Main()
        {
            var db = new PetStoreDbContext();

            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile <PetStoreProfile>();
            });

            IMapper       mapper       = new Mapper(config);
            IPetService   petService   = new PetStoreService(db, mapper);
            IOwnerService ownerService = new OwnerService(db, mapper);

            var toy = new ToyInputViewModelService
            {
                Name    = "car",
                Price   = 30,
                OwnerId = 1
            };

            ownerService.BuyToy(toy);
        }