i create this class and it have this constructor :
public class ReturnResult : ImplicitReturnResult
{
public bool Success { get; }
public ResultStatus Status { get; }
public string Message { get; }
public ReturnResult(bool Success, ResultStatus Status, string Message = null)
{
this.Success = Success;
this.Status = Status;
this.Message = Message ?? Status.ToDisplay();
}
}
and in this class i need to use constructor this class :
public class ImplicitReturnResult
{
public static implicit operator ReturnResult(OkResult result)
{
return new ReturnResult(true, ResultStatus.Success);
}
}
i using this code but it show me this error :
Error CS0556 User-defined conversion must convert to or from the enclosing
whats the problem ? how can i solve this problem ????
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)