public StudentModel() { this.id = 0; this.firstName = null; this.lastName = null; this.age = 0; this.grade = 0.0d; this.marks = new HashSet<MarkModel>(); this.school = null; }
public SchoolModel GetStudetById(int schoolId) { var school = this.universityRepository.Get(schoolId); var model = new SchoolModel { Id = school.Id, Name = school.Name }; return model; }
public HttpResponseMessage AddNewSchool(University model) { var result = this.universityRepository.Add(model); var newSchool = new SchoolModel { Id = result.Id, Name = result.Name }; var response = this.Request.CreateResponse(HttpStatusCode.Created, newSchool); response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = newSchool.Id })); return response; }