Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Are there are any major design flaws / smells in creating a web api as described below

The models I have

public class CourseModel {
    public String Name {get; set;}
    public IList<StudentModel> EnrolledStudents {get; set;}
 }

public class StudentModel {
    public string Name {get; set;}
}

The endpoints for operations on courses

public IEnumerable<CourseModel> Get() { //return all courses}
public void Post(string courseName) {//Create Course}
public void Put(string courseName, string newCourseName) { //UpdateCourse }
public void Delete(string courseName) { //DeleteCourse }
public void AddStudent(string studentName, string courseName) { //Add student to course }
public void RemoveStudent(string studentName, string courseName) { //remove stude from course }

I am worried I'm missing something as I am used to seing the AddStudent/RemoveStudent done with a Put endpoint such as

public void Put(CourseModel model) { //Get stored entity and determine updates }
share|improve this question
    
There's no compelling need to map the names of you endpoint methods precisely to the HTTP verbs. Use names that best describe their function. –  Robert Harvey Dec 17 '14 at 16:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.