コード例 #1
0
        public ActionResult Delete(long id)
        {
            Client client = studentsAPIClients.GetAll()[Convert.ToInt32(id) - 1];

            if (client.ClientId.Equals("StudentAPIAdmin"))
            {
                return(NotFound());
            }
            studentsAPIClients.Delete(client);
            return(Ok());
        }
        public ActionResult DeleteClient(/*[FromQuery]*/ string id)
        {
            Client client = clientsService.GetAll().Where(c => c.ClientId == id).FirstOrDefault();

            if (client == null)
            {
                return(NotFound($"Client with id={id} was not found!"));
            }

            clientsService.Remove(client);

            return(Ok());
        }
コード例 #3
0
 public Task <Client> FindClientByIdAsync(string clientId)
 {
     return(Task.FromResult(clients.GetAll().SingleOrDefault(c => c.ClientId == clientId)));
 }