コード例 #1
0
        public void AddSubject()
        {
            Subject subject = new Subject();

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