Beispiel #1
0
 public List <Entry> Get(Guid id)
 {
     _logger.LogDebug("Retrieving all entries for phoneBook {phoneBookId}", id);
     if (id == Guid.Empty)
     {
         id = _phoneBookDA.GetDefaultPhoneBook(_connection).Id;
     }
     return(_entryDA.GetByPhoneBook(id, _connection));
 }
Beispiel #2
0
        public List <Entry> Search([FromBody] EntrySearchRequest entrySearch)
        {
            if (entrySearch.PhoneBookId == Guid.Empty)
            {
                entrySearch.PhoneBookId = _phoneBookDA.GetDefaultPhoneBook(_connection).Id;
            }
            var found = _entryDA.Search(entrySearch.SearchText, entrySearch.PhoneBookId, _connection);

            return(found);
        }
Beispiel #3
0
        public Guid Insert([FromBody] Entry entry)
        {
            if (entry.PhoneBookId == Guid.Empty)
            {
                entry.PhoneBookId = _phoneBookDA.GetDefaultPhoneBook(_connection).Id;
            }
            _logger.LogDebug("Inserting new entry {entry}", entry);
            var inserted = _entryDA.Insert(entry, _connection);

            return(inserted.Id);
        }