Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IRepository <ToDoItem> repository =
                new RavenSupport.RavenToDoItemRepository("ToDoDB");
            var toDoAR = new ToDoAggregateRoot(repository);
            //var domani = DateTime.Today.Tomorrow();
            //toDoAR.Pianifica(
            //    domani.At(9)
            //    ,
            //    4
            //    ,
            //    CoseDaFare.SviluppoSoftware
            //    ,
            //    "Strumento di marketing"
            //)
            //.Pianifica(
            //    domani.At(14,30)
            //    ,
            //    0.5M
            //    ,
            //    CoseDaFare.Appuntamento
            //    ,
            //    "Con Gigi"
            //)
            //.Pianifica(
            //    domani.At(16,30)
            //    ,
            //    1
            //    ,
            //    CoseDaFare.Formazione
            //    ,
            //    "Corso Javascript"
            //);

            var toDoDataContext = new ToDoItemsDataContext(repository);

            var items = toDoDataContext.GetAllToDoItems();

            foreach (var item in items)
            {
                System.Console.WriteLine(
                    "{0} {1} {2}"
                    , item.Data, item.Ora, item.Cosa
                    );
                var toDoItem = repository.Get(item.ToDoItemId);
            }
            System.Console.ReadLine();
        }
 public ToDoItemsController()
 {
     _repository    = new RavenToDoItemRepository("ToDoDB");
     _aggregateRoot = new ToDoAggregateRoot(_repository);
     _dataContext   = new ToDoItemsDataContext(_repository);
 }