24 lines
543 B
C#
24 lines
543 B
C#
namespace LaaProductionWeb.Services.Models
|
|
{
|
|
using Newtonsoft.Json;
|
|
|
|
public class HttpResponseModel
|
|
{
|
|
public bool Succeeded { get; internal set; }
|
|
|
|
public string Content { get; internal set; }
|
|
|
|
public string Error { get; internal set; }
|
|
|
|
public T Deserialize<T>() where T : new ()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(this.Content))
|
|
{
|
|
return JsonConvert.DeserializeObject<T>(this.Content);
|
|
}
|
|
|
|
return new T();
|
|
}
|
|
}
|
|
}
|