mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 23:33:08 +01:00
03fa6f74e9
Methods now return LastResponse or ListResponse (confusing? hmm) instead of throwing exceptions.
40 lines
806 B
C#
40 lines
806 B
C#
using IF.Lastfm.Core.Api.Enums;
|
|
|
|
namespace IF.Lastfm.Core.Api.Helpers
|
|
{
|
|
public class LastResponse
|
|
{
|
|
#region Properties
|
|
|
|
public bool Success { get; set; }
|
|
public LastFmApiError Error { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Factory methods
|
|
|
|
public static LastResponse CreateSuccessResponse()
|
|
{
|
|
var r = new LastResponse
|
|
{
|
|
Success = true,
|
|
Error = LastFmApiError.None
|
|
};
|
|
|
|
return r;
|
|
}
|
|
|
|
public static LastResponse CreateErrorResponse(LastFmApiError error)
|
|
{
|
|
var r = new LastResponse
|
|
{
|
|
Success = false,
|
|
Error = error
|
|
};
|
|
|
|
return r;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |