public void AddSubject() { Subject subject = new Subject(); subject.ID = Guid.NewGuid(); subject.Name = "РВИП"; subject.Description = "Распределйнные вычисления и программы"; subject.Exam = true; subject.Project = false; subjectRepository.AddSubject(subject); }
// POST api/<controller> public IHttpActionResult Post([FromBody] TestSubject dataTestSubject) { if (dataTestSubject == null) { return(BadRequest("Data is empty")); } else { _repo.AddSubject(dataTestSubject); } return(Ok("success")); }