I'm writing my first MVC5 API in Visual Studio 2017 and C#. I'm not doing this in .net Core because I need to use CSOM, SharePont online Client object to update SharePoint online Document Library column data and that is no yet supported in .net Cored.
I seem to understand more about MVC routing in regular Controller and Actions but I'm very lost in the API configuration. I used the MVC WEB API template and created the basic Get, ..post...Put..Delete.... public method under my API.
The first one method I want to do is to perform an update on a column data on the SPO Document Library's column. I supposed that would be the Put method? Or can I rename that method? I coded my method as below and when I put in http it just defaults to the first Get method with no parameter. What should I add in the WebApiConfig.cs for this to work. I'm passing in a string value like "True" or "False", the method then assign this string to the column data of the document library. The problem is it's not even getting hit.
I read a couple of article online which kept sending me to another link, another.... I'm just very confused and still don't know how to setup the WebApiConfig.cs
Before the declaration of my public API class, I have
// PUT api/<controlle
// PUT api/<controller>/False
public void Put(string flagValue)
List pnpList = pnpContext.Web.Lists.GetByTitle("GetAlarmsListing");
CamlQuery query = CamlQuery.CreateAllItemsQuery();
ListItemCollection allPnpDocs = pnpList.GetItems(query);
foreach (ListItem pnpDoc in allPnpDocs)
pnpDoc["90DaysAlarmSent"] = flagValue;
pnpDoc["Title"] = flagValue;//30DaysAlarmSent