public IHttpActionResult Get(int customGroupId, int projectGroupId) { CustomProjectGroupRepository customProjectGroupRepository = new CustomProjectGroupRepository(Convert.ToInt32(Request.Headers.GetValues("CurrentUserID").First())); List <CustomProjectGroup> customProjectGroupList = customProjectGroupRepository.GetCustomProjectGroups(customGroupId, projectGroupId); return(Json(new { CustomProjectGroups = customProjectGroupList })); }
// POST: api/ProjectGroupUser public IHttpActionResult Post([FromBody] List <CustomProjectGroup> customProjectGroups, int customGroupId, int projectGroupId) { CustomProjectGroupRepository customProjectGroupRepository = new CustomProjectGroupRepository(Convert.ToInt32(Request.Headers.GetValues("CurrentUserID").First())); customProjectGroupRepository.SaveCustomProjectGroups(customProjectGroups, customGroupId, projectGroupId); return(Json(new { count = customProjectGroups.Count.ToString() })); }