@manhnguyenv

Welcome to my blog!

RestSharp

May 17, 2020 15:36

RestSharp (edit)

  • .NET Framework 4.5
  • Newtonsoft.Json 12.0.3
  • Dapper 1.50.2
  • RestSharp 105.2.3

https://visualstudiomagazine.com/articles/2015/10/01/consume-a-webapi.aspx

https://stackify.com/restsharp/

https://github.com/restsharp/RestSharp

WinForms + RestSharp + ASP.NET Web API 2

February 22, 2020 15:30

ASP.NET Web API 2, RestSharp and Model Error Messages

CallerRepository class

static void Main(string[] args)
{
    EmployeeInfo model = new EmployeeInfo();
    CallerRepository caller = new CallerRepository();
    try
    {
        var response = caller.Get();
        foreach (var res in response)
        {
            Console.WriteLine($"{res.Id} {res.EmpNo} {res.EmpName} {res.Salary} {res.DeptName} {res.Designation}");
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Error Occured " +
            $"{ex.Message}");
    }
    Console.ReadLine();
}

https://www.dotnetcurry.com/aspnet/1419/handle-webapi-restsharp-model-error-messages

Categories

Recent posts