If you want to be able to call this from your Controller, simply make it a public method on a particular controller which would allow you to access it via a URL, however I'm not entirely sure how this third-party tool works as it looks like it's expecting
those methods to be called from another source itself.
You posted what looks like some kind of event handler extension. I assume there is an event somewhere that is calling into this static method. Your action method would need to first invoke the event in order to populate the sender and FileManagerCreatingEventArgs.
Then there's SaveEventInfo which must be another static method in the current static class.
Anyway, it is probably not possible given the code snippet. Maybe if you explain what you're trying to do at a high level someone can point you in the right direction.
Participant
788 Points
1382 Posts
convert private static method to MVC ActionResult...
Apr 19, 2017 07:11 PM|slimbunny|LINK
How to convert the following code to ASP.NET MVC C# ActionResult in a Controller?
using GleamTech.FileUltimate;
private static void FileManagerCreating(object sender, FileManagerCreatingEventArgs e) { SaveEventInfo(new Dictionary<string, object> { {"Event Type", "Creating"}, {"Path", e.Folder.FullPath}, {"Creating Folder", e.ItemName} }); }
All-Star
113110 Points
18367 Posts
MVP
Re: convert private static method to MVC ActionResult...
Apr 19, 2017 07:56 PM|Rion Williams|LINK
If you want to be able to call this from your Controller, simply make it a public method on a particular controller which would allow you to access it via a URL, however I'm not entirely sure how this third-party tool works as it looks like it's expecting those methods to be called from another source itself.
I'd highly recommend checking out the Events documentation for that product as it has a complete MVC implementation as seen below:
All-Star
30961 Points
11265 Posts
Re: convert private static method to MVC ActionResult...
Apr 19, 2017 07:59 PM|mgebhard|LINK
You posted what looks like some kind of event handler extension. I assume there is an event somewhere that is calling into this static method. Your action method would need to first invoke the event in order to populate the sender and FileManagerCreatingEventArgs. Then there's SaveEventInfo which must be another static method in the current static class.
Anyway, it is probably not possible given the code snippet. Maybe if you explain what you're trying to do at a high level someone can point you in the right direction.