|
@@ -25,25 +25,28 @@ namespace WebAPiUtils_test.DataAccess
|
25
|
25
|
};
|
26
|
26
|
}
|
27
|
27
|
|
28
|
|
- public override T_SqlManager DboAddToDb(ValuesDboAdd obj)
|
|
28
|
+ public override OpResult<T_SqlManager> DboAddToDb(ValuesDboAdd obj)
|
29
|
29
|
{
|
30
|
|
- return new T_SqlManager
|
|
30
|
+ var res = GetSingleById(obj.TextId);
|
|
31
|
+ if (!res)
|
|
32
|
+ return res.To<T_SqlManager>();
|
|
33
|
+ return OpResult<T_SqlManager>.Ok(new T_SqlManager
|
31
|
34
|
{
|
32
|
35
|
my_string = obj.MyString,
|
33
|
36
|
my_int = obj.MyInt,
|
34
|
37
|
text = obj.TextId
|
35
|
|
- };
|
|
38
|
+ });
|
36
|
39
|
}
|
37
|
40
|
|
38
|
|
- public override T_SqlManager DboEditToDb(ValuesDboEdit obj, T_SqlManager edit)
|
|
41
|
+ public override OpResult<T_SqlManager> DboEditToDb(ValuesDboEdit obj, T_SqlManager edit)
|
39
|
42
|
{
|
40
|
|
- return new T_SqlManager
|
41
|
|
- {
|
42
|
|
- id = edit.id,
|
43
|
|
- my_string = obj.MyString,
|
44
|
|
- my_int = obj.MyInt,
|
45
|
|
- text = obj.TextId
|
46
|
|
- };
|
|
43
|
+ var res = GetSingleById(obj.TextId);
|
|
44
|
+ if (!res)
|
|
45
|
+ return res.To<T_SqlManager>();
|
|
46
|
+ edit.my_string = obj.MyString;
|
|
47
|
+ edit.my_int = obj.MyInt;
|
|
48
|
+ edit.text = obj.TextId;
|
|
49
|
+ return OpResult<T_SqlManager>.Ok(edit);
|
47
|
50
|
}
|
48
|
51
|
|
49
|
52
|
public static OpResult<DboGetMultiple<ValuesDboGet>> Contains(string text, int page, int perPage)
|