public Models.User GetById(int id)
 {
     Models.User users = new Models.User();
     using (var kullanici = new Models.KampContext())
     {
         users = kullanici.Users.FirstOrDefault(x => x.Id == id);
     }
     return(users);
 }
        public List <Models.User> GetAll()
        {
            List <Models.User> users = new List <Models.User>();

            using (var kullanicilar = new Models.KampContext())
            {
                users = kullanicilar.Users.ToList();
            }
            return(users);
        }
        public bool Login(string email, string password)
        {
            bool deger = false;

            using (var x = new Models.KampContext())
            {
                var veri = x.Users.Where(y => y.Email == email && y.Password == password).FirstOrDefault();
                if (veri != null && veri.Id > 0)
                {
                    deger = true;
                }
            }
            return(deger);
        }
        public bool Kayit(LoginData.Models.User registration)
        {
            bool result = true;

            using (var srv = new Models.KampContext())
            {
                if (registration.Id > 0)
                {
                }
                else
                {
                    srv.Users.Add(registration);
                }
                srv.SaveChanges();
            }
            return(result);
        }