public GuestbookServices(IUnitOfWork unitOfWork, IGuestbookRepository dal, IPasswordLibRepository passwordLibRepository)
 {
     this._dal              = dal;
     base.BaseDal           = dal;
     _unitOfWork            = unitOfWork;
     _passwordLibRepository = passwordLibRepository;
 }
Exemple #2
0
 public HomeController(IGuestbookRepository guestbookRepository,
                       IMessageSender messageSender,
                       IGuestbookService guestbookService)
 {
     _guestbookRepository = guestbookRepository;
     _messageSender       = messageSender;
     _guestbookService    = guestbookService;
 }
Exemple #3
0
 public GuestbookService(IUnitOfWork unitOfWork,
                         IMapper mapper,
                         IGuestbookRepository guestbookRepository)
     : base(unitOfWork)
 {
     _mapper = mapper;
     _guestbookRepository = guestbookRepository;
 }
 public GuestbookNotificationHandler(IGuestbookRepository guestbookRepository, IMessageSender messageSender)
 {
     _guestbookRepository = guestbookRepository;
     _messageSender       = messageSender;
 }
 public GuestbookController(GuestbookRepository guestbookRepository)
 {
     _repository = guestbookRepository;
 }
Exemple #6
0
 public GuestbooksController(IGuestbookRepository guestbookRepository)
 {
     _guestbookRepository = guestbookRepository;
 }
 public HomeController(IGuestbookRepository guestbookRepository, IGuestbookService guestbookService)
 {
     _guestbookRepository = guestbookRepository;
     _guestbookService    = guestbookService;
 }
 public GuestbookEntryController(
     IGuestbookRepository repository)
 {
     _repository = repository;
 }
Exemple #9
0
 public HomeController(IGuestbookRepository guestbookRepository, ILogger logger)
 {
     _guestbookRepository = guestbookRepository;
     _logger = logger;
 }
 public GuestbookController(IGuestbookRepository rep)
 {
     this._rep = rep;
 }
Exemple #11
0
 public ValidateGuestbookExistsFilterImpl(IGuestbookRepository guestbookRepository)
 {
     _guestbookRepository = guestbookRepository;
 }
 public GuestbookController(IGuestbookRepository rep)
 {
     this._rep = rep;
 }
 public GuestbookController(IGuestbookRepository repository) // costruttore utilizzato nei test per iniettare un'implementazione fake del repository
 {
     _repository = repository;
 }
 public GuestbookController()   // costruttore di default invocato dal framework quando l'applicazione viene eseguita
 {
     _repository = new GuestbookRepository();
 }
Exemple #15
0
        static void Main(string[] args)
        {
            /*Console.WriteLine("Hello World!");
             * IEntity<int> theEntity = new Guestbook();
             * Console.WriteLine(theEntity.ToString());
             * //Console.WriteLine(theEntity.IsTransient().ToString());
             * Entity theOtherEntity = new Guestbook();
             *
             * Console.WriteLine(theOtherEntity.IsTransient().ToString());
             *
             * // #2 static factory
             * Entity theThirdEntity = Guestbook.CreateGuestbook("novia visitor book");
             * ////////////////////////
             * IGuestbook theBook = Guestbook.CreateGuestbook("visit book");
             *
             * IGuestbookEntry theFirstEntry = new GuestbookEntry();
             * IGuestbookEntry theSecondEntry = new GuestbookEntry();
             *
             * // --------------------------------
             * theBook.AddEntry(theFirstEntry);
             * theBook.AddEntry(theSecondEntry);
             *
             * // --------------------------------
             * ///*/

            ////////////////////////
            var serviceCollection = new ServiceCollection();

            var bootStrapper = new Startup();

            bootStrapper.ConfigureServices(serviceCollection);

            var serviceProvider = serviceCollection.BuildServiceProvider();

            using (EfGuestbookDbContext theContext = serviceProvider.GetService <EfGuestbookDbContext>())
            {
                ////////////////////////
                // hard work
                // The transient objects
                IGuestbook guestbook = serviceProvider.GetService <IGuestbook>();
                guestbook.Name = "Novia";

                IGuestbookEntry guestbookEntry = null;

                //#1
                guestbookEntry = serviceProvider.GetService <IGuestbookEntry>();
                guestbook.AddEntry(guestbookEntry);

                //#2
                guestbookEntry         = serviceProvider.GetService <IGuestbookEntry>();
                guestbookEntry.Message = "Testing entry.";
                guestbook.AddEntry(guestbookEntry);


                // Add the transient object to a repository, which knows how to store
                IGuestbookRepository theBookRepository = serviceProvider.GetService <IGuestbookRepository>();
                theBookRepository.Add(guestbook);

                //-------
                IGuestbook theBook = theBookRepository.GetById(3);
                //IGuestbook theBook = theBookRepository.ListAll()
                //    .ToList() // tuns the sql
                //    .Where(theIteratorBook => theIteratorBook.Name == "Novia").FirstOrDefault();

                theBook.Name = "Novia2";

                theBookRepository.Update(theBook as Guestbook);

                //-------

                ////////////////////////

                // Commit to the database
                theContext.SaveChanges();
            }
        }
Exemple #16
0
 public GuestbookService(IGuestbookRepository guestbookRepository)
 {
     _guestbookRepository = guestbookRepository;
 }
 public GuestbookController(IGuestbookRepository repository)
 {
     _repository = repository;
 }
Exemple #18
0
 public GuestbookServices(IGuestbookRepository dal)
 {
     this._dal    = dal;
     base.BaseDal = dal;
 }
Exemple #19
0
 public GuestbookManagement(IGuestbookRepository guestbookRepository)
 {
     mGuestbookRepository = guestbookRepository;
 }
 public GuestbookController()
 {
     _repository = new GuestbookRepository();
 }
 public GuestbookService(IGuestbookRepository repository)
 {
     this.Repository = repository ?? throw new ArgumentNullException("repository cannot be null");
 }
 public GuestbookEntryController()
 {
     _repository = new GuestbookRepository();
 }
 public VerifyGuestbookExistsFilter(IGuestbookRepository guestbookRepository)
 {
     _guestbookRepository = guestbookRepository;
 }