예제 #1
0
 public BooksRepository()
 {
     try
     {
         ConnectionInfo = new EntityConnection();
         BooksViewPoint = new ObservableCollection <BookInfo>();
         using (var DbContext = ConnectionInfo.GetContext())
         {
             var converter = new BookConverter();
             foreach (var Book in DbContext.Books)
             {
                 BooksViewPoint.Add(converter.ToInfo(Book));
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionLogger.Log(ex);
     }
 }