Example #1
0
 void FilterContacts(string text)
 {
     if (string.IsNullOrEmpty(text))
     {
         Contacts = ContactsBackup;
     }
     else
     {
         text     = text.ToLower();
         Contacts = new ObservableCollection <Contact>(ContactsBackup.Where(c => c.ToString().ToLower().Contains(text.ToLower())));
     }
 }
Example #2
0
 // PUT api/<controller>/5
 /// <summary>
 /// Puts the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 /// <exception cref="HttpResponseException"></exception>
 public ContactsBackup Put(string id, [FromBody] ContactsBackup value)
 {
     return(ContactsBackupManager.UpdateItem(value));
 }
Example #3
0
 // POST api/<controller>
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public ContactsBackup Post([FromBody] ContactsBackup value)
 {
     return(ContactsBackupManager.AddItem(value));
 }