public JsonResult Save(string recipeText, FormCollection data) { var parser = new MMFRecipeParser(); var recipe = parser.Parse(recipeText); MongoStorageProvider mongoStorageProvider = new MongoStorageProvider(); mongoStorageProvider.Save(recipe.ToString()); return Json(recipe); }
public JsonResult Parse(string recipeText, FormCollection data) { try { var parser = new MMFRecipeParser(); var recipe = parser.Parse(recipeText); var service = new RecipeService(); service.Save(recipe); return Json(recipe); } catch (Exception ex) { return Json(ex); } }