BllResultFactory.cs
2.19 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HHECS.Model
{
public class BllResultFactory
{
public static BllResult<T> Sucess<T>(T data, String msg)
{
return new BllResult<T>(true, msg, data);
}
public static BllResult<T> Sucess<T>(T data)
{
return new BllResult<T>(true, "", data);
}
public static BllResult<T> Sucess<T>(String msg)
{
return new BllResult<T>(true, msg, default(T));
}
public static BllResult<T> Sucess<T>()
{
return new BllResult<T>(true, "", default(T));
}
public static BllResult<T> Error<T>(T data, String msg)
{
return new BllResult<T>(false, msg, data);
}
public static BllResult<T> Error<T>(T data)
{
return new BllResult<T>(false, "", data);
}
public static BllResult<T> Error<T>(String msg)
{
return new BllResult<T>(false, msg, default(T));
}
public static BllResult<T> Error<T>()
{
return new BllResult<T>(false, "", default(T));
}
public static BllResult Sucess(Object data, String msg)
{
return new BllResult(true, msg, data);
}
public static BllResult Sucess(Object data)
{
return new BllResult(true, "", data);
}
public static BllResult Sucess(String msg)
{
return new BllResult(true, msg, null);
}
public static BllResult Sucess()
{
return new BllResult(true, "", null);
}
public static BllResult Error(object data, String msg)
{
return new BllResult(false, msg, data);
}
public static BllResult Error(object data)
{
return new BllResult(false, "", data);
}
public static BllResult Error(String msg)
{
return new BllResult(false, msg, null);
}
public static BllResult Error()
{
return new BllResult(false, "", null);
}
}
}