0

I am migrating my windows based application into DOT NET CORE MVC WEB-BASED APPLICATION. During this time I am getting errors.

My variable details

private DateTime _dateTime = DateTime.Now;
private string _dateTimeFormat = "{0}:{1}:{2}";

The Method which I am going to execute.

internal static async Task<Asset> METHODNAME(PARAMETERS DETAILS)
{
...
//MY code here 
await blockAsync.ContinueWith(t =>
     {
          UpdateDateTime(PASS PARAMETER DETAILS in DOUBLE);
     }
}

UpdateDateTime function details.

private void UpdateDateTime(double Value)
{           
    // Update end time
    _dateTime = DateTime.Now;
    string CurrentTime = string.Format(_dateTimeFormat, _dateTime.Hour, 
    _dateTime.Minute, _dateTime.Second);
   //Other Code Here
}
  • 1
    `UpdateDateTime` is an instance method. What instance are you trying to call it on? Either an instance needs to be specified or perhaps `METHODNAME` shouldn't have been `static`. – David Mar 29 '22 at 14:17

0 Answers0