I have a controller in my mvc4 web application in which there is an action that needs to call another function. What happens in that function i.e. the return value is not important for my action. How i can call that function and never wait for it to be executed?I think it can be done by async but my point is not to use resources, just call the function and never wait for it what ever happens.Please give me some advise.
call a function and never wait for it in C#
c#;.net;asp.net;asp.net mvc
private void Demo(){    // Do something, given that the result doesn't matter.}public void Do(){    Task.Factory.StartNew(this.Demo);    // The following line will be executed without waiting for the result.    DoSomethingElse();}Note that starting a method without caring about the result or about exceptions it can throw is risky.If an exception is thrown in a Task, it will be hidden until you:Observe the Result,Wait() for the task, or:The GC calls the finalizer on the Task.You can handle yourself 1. and 2. shortly after you call the method, or you can attach a continuation with myTask.OnComplete(myErrorHandler, TaskContinuationOptions.OnlyOnFaulted) to be run when the original task throws an exception. 3. will crash your process; don't do that.