Exemplo n.º 1
0
        /// <summary>
        /// Löscht den übergebenen Logeintrag
        /// </summary>
        /// <param name="logEntry"></param>
        public void Delete(LogEntry logEntry)
        {
            if (logEntry == null) throw new ArgumentNullException(nameof(logEntry));

            GraphClient.Cypher
                .Match("".LogEntry("le").AnyInboundRelationsAs("r").Node(""))
                .Where((LogEntry le) => le.Id == logEntry.Id).Delete("le, r").ExecuteWithoutResults();
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Lädt die VM relevanten Daten
        /// </summary>
        /// <param name="logEntry"></param>
        /// <returns></returns>
        public ILogItemViewModel LoadData(LogEntry logEntry)
        {
            if (logEntry == null) throw new ArgumentNullException(nameof(logEntry));
            LogEntry = logEntry;
            Memo = LogEntry.Memo;
            Date = LogEntry.DateTime;

            return this;
        }
Exemplo n.º 3
0
 /// <summary>
 ///     Speichert den Logeintrag
 /// </summary>
 /// <param name="logEntry"></param>
 public void Save(LogEntry logEntry)
 {
     if (logEntry == null) throw new ArgumentNullException(nameof(logEntry));
     GraphClient.Cypher.Match("".LogEntry("l"))
         .Where((LogEntry l) => l.Id == logEntry.Id)
         .Set("l.Memo={Memo}, l.DateTime={Date}")
         .WithParams(new Dictionary<string, object> {{"Memo", logEntry.Memo}, {"Date", logEntry.DateTime}})
         .ExecuteWithoutResults();
 }
Exemplo n.º 4
0
        /// <summary>
        ///     Erstellt einen neuen Logeintrag einer Variation
        /// </summary>
        public LogEntry Create(Variation variation, LogEntry logEntry)
        {
            ICypherFluentQuery query = GraphClient.Cypher
                .Match("".Variation("v"))
                .Where((Variation v) => v.Id == variation.Id)
                .Create("".Node("v").Has().LogEntryWithParam())
                .WithParam("logEntry", logEntry);

            return query.Return(le=>le.As<LogEntry>()).Results.First();
        }
        public void TestDelete()
        {
            Mock<ILogEntryDao> logEntryDaoMock = new Mock<ILogEntryDao>();
            logEntryDaoMock.Setup(x => x.Delete(It.IsAny<LogEntry>()));

            LogEntry logEntry = new LogEntry();

            ILogEntryService logEntryService = new LogEntryService(logEntryDaoMock.Object);

            logEntryService.Delete(logEntry);
            
            logEntryDaoMock.Verify(x=>x.Delete(logEntry), Times.Once);
        }
Exemplo n.º 6
0
 /// <summary>
 ///     Speichert einen Logeintrag
 /// </summary>
 /// <param name="logEntry"></param>
 public void Save(LogEntry logEntry)
 {
     if (logEntry == null) throw new ArgumentNullException(nameof(logEntry));
     _logEntryDao.Save(logEntry);
 }
 /// <summary>
 ///     Lädt die VM relevanten Daten
 /// </summary>
 /// <param name="logEntry"></param>
 /// <returns></returns>
 public ILogItemViewModel LoadData(LogEntry logEntry)
 {
     throw new NotImplementedException();
 }