public ActionResult <ProductInPlanActionDto> CreateProductInPlanAction(CreateProductInPlanAction newAction) { var action = _mapper.Map <ProductInPlanAction>(newAction); _repository.AddProductInPlanAction(action); return(Ok()); }
private CreateProductInPlanAction CreateAction(ActionType type, int planId, int dailyPlanId, ProductInDietPlan product, string username) { var action = new CreateProductInPlanAction { Username = username, ProductId = product.Product.ProductNo, ProductName = product.Product.ProductName, DailyDietPlanId = dailyPlanId, DietPlanId = planId, Action = type, Created = DateTime.UtcNow }; return(action); }