Пример #1
0
        public State UnRegisterHost(string id)
        {
            HostRepository hostRepo = new HostRepository();
            var            host     = hostRepo.Get(id);

            if (host != null)
            {
                hostRepo.Delete(id);
                hostRepo.Save();
                return(new State()
                {
                    IsError = false, Message = "Host is disconnected!"
                });
            }
            return(new State()
            {
                IsError = true, Message = "There is no any host with this id!"
            });
        }
Пример #2
0
 /// <summary>
 /// The method deletes check from database
 /// </summary>
 /// <param name="check">Models.Check check</param>
 /// <returns></returns>
 public Task <bool> DeleteCheck(Models.Check check)
 {
     return(Task.FromResult(repository.Delete <EntityModels.Check>(buildEntity.EntityModelsCheck(check))));
 }