Skip to content

Commit

Permalink
Fix foodOptions dictionary mapping in PetHelper.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
rpothin committed Apr 3, 2024
1 parent 2356200 commit 8042910
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ public static Guid CreateFeedingActivity(ServiceClient serviceClient, Guid petId
{
var foodOptions = new Dictionary<int, int>
{
{ 913610000, 10 },
{ 913610001, 50 },
{ 913610002, 100 },
{ 913610003, 1000 }
{ 10, 913610000 },
{ 50, 913610001 },
{ 100, 913610002 },
{ 1000, 913610003 }
};

// Get the code corresponding to the requested food quantity
var selectedFoodOption = foodOptions.ElementAt(foodQuantity);
var selectedFoodOption = foodOptions[foodQuantity];

// Create the feeding activity
Entity feedingActivity = new Entity("rpo_feeding");
feedingActivity["rpo_quantity"] = new OptionSetValue(selectedFoodOption.Key);
feedingActivity["rpo_quantity"] = new OptionSetValue(selectedFoodOption);
feedingActivity["regardingobjectid"] = new EntityReference("rpo_pet", petId);

return serviceClient.Create(feedingActivity);
Expand Down

0 comments on commit 8042910

Please sign in to comment.