diff options
author | UbitUmarov | 2019-08-26 03:00:28 +0100 |
---|---|---|
committer | UbitUmarov | 2019-08-26 03:00:28 +0100 |
commit | ab92dff5be6bd9c6a632b9128f970b4793446bb2 (patch) | |
tree | f4bb932496accffbf35221b003050c06f5292fb7 /OpenSim/Data/Null | |
parent | Fix console outputting raw format strings (diff) | |
download | opensim-SC-ab92dff5be6bd9c6a632b9128f970b4793446bb2.zip opensim-SC-ab92dff5be6bd9c6a632b9128f970b4793446bb2.tar.gz opensim-SC-ab92dff5be6bd9c6a632b9128f970b4793446bb2.tar.bz2 opensim-SC-ab92dff5be6bd9c6a632b9128f970b4793446bb2.tar.xz |
a few changes to db generic tables
Diffstat (limited to 'OpenSim/Data/Null')
-rw-r--r-- | OpenSim/Data/Null/NullGenericDataHandler.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Data/Null/NullGenericDataHandler.cs b/OpenSim/Data/Null/NullGenericDataHandler.cs index dd9d190..0b6e49b 100644 --- a/OpenSim/Data/Null/NullGenericDataHandler.cs +++ b/OpenSim/Data/Null/NullGenericDataHandler.cs | |||
@@ -42,6 +42,47 @@ namespace OpenSim.Data.Null | |||
42 | /// </summary> | 42 | /// </summary> |
43 | public class NullGenericDataHandler | 43 | public class NullGenericDataHandler |
44 | { | 44 | { |
45 | protected List<T> Get<T>(string field, string val, List<T> inputEntities) | ||
46 | { | ||
47 | List<T> entities = inputEntities; | ||
48 | |||
49 | entities | ||
50 | = entities.Where( | ||
51 | e => | ||
52 | { | ||
53 | FieldInfo fi = typeof(T).GetField(field); | ||
54 | if (fi == null) | ||
55 | throw new NotImplementedException(string.Format("No field {0} for val {1}", field, val)); | ||
56 | |||
57 | return fi.GetValue(e).ToString() == val; | ||
58 | } | ||
59 | ).ToList(); | ||
60 | |||
61 | return entities; | ||
62 | } | ||
63 | |||
64 | protected List<T> Get<T>(string field, string[] vals, List<T> inputEntities) | ||
65 | { | ||
66 | List<T> entities = new List<T>(); | ||
67 | |||
68 | for (int i = 0; i < vals.Length; i++) | ||
69 | { | ||
70 | entities.AddRange (inputEntities.Where( | ||
71 | e => | ||
72 | { | ||
73 | FieldInfo fi = typeof(T).GetField(field); | ||
74 | if (fi == null) | ||
75 | throw new NotImplementedException(string.Format("No field {0} for val {1}", field, vals[i])); | ||
76 | |||
77 | return fi.GetValue(e).ToString() == vals[i]; | ||
78 | } | ||
79 | ).ToList() | ||
80 | ); | ||
81 | } | ||
82 | return entities; | ||
83 | } | ||
84 | |||
85 | |||
45 | protected List<T> Get<T>(string[] fields, string[] vals, List<T> inputEntities) | 86 | protected List<T> Get<T>(string[] fields, string[] vals, List<T> inputEntities) |
46 | { | 87 | { |
47 | List<T> entities = inputEntities; | 88 | List<T> entities = inputEntities; |