public HttpResponseMessage Update(UpdateInstructorInfo model, int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            SucessResponse response = new SucessResponse();

            _instructorsService.Update(model);
            return(Request.CreateResponse(response));
        }
Beispiel #2
0
        public void Update(UpdateInstructorInfo model)
        {
            DataProvider.ExecuteNonQuery(GetConnection, "dbo.Instructors_Update",

                                         inputParamMapper : delegate(SqlParameterCollection updateinstructors)
            {
                updateinstructors.AddWithValue("@Id", model.Id);
                updateinstructors.AddWithValue("@Name", model.Name);
                updateinstructors.AddWithValue("@Email", model.Email);
                updateinstructors.AddWithValue("@Bio", model.Bio);
                updateinstructors.AddWithValue("@LinkedIn", model.LinkedIn);
                updateinstructors.AddWithValue("@CoursesTaught", String.Join("|", model.CoursesTaught));
            });
        }