public ActionResult CreateFavoriteCategory([FromBody] CreateFavoriteCategoryRequest request) { using (var client = GetMainServiceClient()) { var resultIds = client.CreateFavoriteCategory(request.CategoryId, request.Title, request.LabelIds); return(Json(resultIds)); } }
public ActionResult CreateFavoriteCategory([FromBody] CreateFavoriteCategoryRequest request) { var client = GetFavoriteClient(); var resultIds = new List <long>(); foreach (var requestLabelId in request.LabelIds) { var resultId = client.CreateFavoriteCategory(new CreateFavoriteCategoryContract { CategoryId = request.CategoryId, FavoriteLabelId = requestLabelId, Title = request.Title, }); resultIds.Add(resultId); } return(Json(resultIds)); }