-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAppDomainResponseMessage.cs
29 lines (25 loc) · 1.01 KB
/
AppDomainResponseMessage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using OperationMessaging;
namespace AppDomainMessaging
{
/// <summary>
/// https://msdn.microsoft.com/en-us/library/system.net.http.httpresponsemessage(v=vs.118).aspx
/// </summary>
[Serializable]
public sealed class AppDomainResponseMessage
{
public AppDomainContent Content { get; set; }
public bool IsSuccess => StatusCode == AppDomainStatusCodes.OK
|| StatusCode == AppDomainStatusCodes.Created
|| StatusCode == AppDomainStatusCodes.NoContent;
public AppDomainStatusCodes StatusCode { get; set; }
public static AppDomainResponseMessage FromOperationResult(OperationResponse response)
{
return new AppDomainResponseMessage
{
Content = new AppDomainContent {Content = response.Result.ToString()},
StatusCode = response.Succes ? AppDomainStatusCodes.OK : AppDomainStatusCodes.InternalServerError
};
}
}
}