private void StudentI_Attach(Studenti entity)
		{
			entity.Kurzy = this;
		}
		private void StudentI_Detach(Studenti entity)
		{
			entity.Kurzy = null;
		}
        public JObject Post(JObject o)
        {
            Studenti s;

            using (var db = DrivingScoolContextHelper.CreateDataContext2())
            {                
                try
                {
                    db.Studenti.InsertOnSubmit(s = new Studenti()
                    {
                        MatricniCislo = o.Value<string>("matricni_cislo"),
                        Jmeno = o.Value<string>("jmeno"),
                        Prijmeni = o.Value<string>("prijmeni"),
                        KurzID = o.Value<uint>("kurz_id")
                    });                    
                    db.SubmitChanges();                    
                }
                catch (MySqlException)
                {
                    throw new HttpResponseException(HttpStatusCode.InternalServerError);
                }
            }            
            return Get(null, (int?) s.StudentID);
        }