public ActionResult Update(Models.Translation model) { using (var client = new JsonServiceClient()) { var putUrl = new Uri(Request.Url, string.Format("/api/translation/{0}/{1}", model.Alpha2, model.Language)); var translation = new Api.Messages.Translation { Data = model.Name }; var response = client.Put<Api.Messages.TranslationResponse>(putUrl.ToString(), translation); } return Redirect("Index"); }
public ActionResult Create(Models.Translation model) { using (var client = new JsonServiceClient()) { var postUrl = new Uri(Request.Url, "/api/translation"); var translation = new Api.Messages.Translation { Code = model.Alpha2, Language = model.Language, Data = model.Name }; var response = client.Post<Api.Messages.TranslationResponse>(postUrl.ToString(), translation); } return Redirect("Index"); }