//[AcceptVerbs("OPTIONS")]

        public Client PutClient(string cin, Client Client)
        {
            if (!ModelState.IsValid)
            {
                new Client();
            }

            if (cin != Client.cin)
            {
                new Client();
            }

            db.Entry(Client).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                
            }

            return Client;
        }
        public bool PostClientLogin(Client client)
        {
            if (!ModelState.IsValid)
            {
                return false;
            }


            return db.Clients.Where(c => c.cin.Equals(client.cin) && c.password.Equals(client.password)).Count() >0;
        }
        // POST api/client
        public async Task<Client> Post(Client client)
        {
           
            if (!ModelState.IsValid)
            {
                return null;
            }
            

            db.Clients.Add(client);
            await db.SaveChangesAsync();

            return client;
        }