File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ Basics for .Net ( .Net Standard 2.0 )
13
13
[ ] ...
14
14
15
15
## Changelog
16
+ ### Version 1.1.10 - 09/2019
17
+ * Add: DB_Attributes.TableNameAttribute
18
+ * Add: EnumerableExtensions
19
+
16
20
### Version 1.1.9 - 08/2019
17
21
* NameValue: override string ToString()
18
22
* Open source ...
Original file line number Diff line number Diff line change
1
+
2
+ using System ;
3
+ using System . Collections ;
4
+ using System . Collections . Generic ;
5
+ using System . Collections . Specialized ;
6
+ using System . Data ;
7
+ using System . Diagnostics ;
8
+ using System . Linq ;
9
+ using System . Reflection ;
10
+ using System . Text ;
11
+ using System . Threading . Tasks ;
12
+
13
+ #if XF
14
+ using Xamarin . Forms ;
15
+ #endif
16
+
17
+ public static class EnumerableExtensions
18
+ {
19
+ /// <summary>
20
+ /// Returns the index of the specified object in the collection.
21
+ /// </summary>
22
+ /// <param name="self">The self.</param>
23
+ /// <param name="obj">The object.</param>
24
+ /// <returns>If found returns index otherwise -1</returns>
25
+ public static int IndexOf ( this IEnumerable self , object obj )
26
+ {
27
+ int index = - 1 ;
28
+
29
+ var enumerator = self . GetEnumerator ( ) ;
30
+ enumerator . Reset ( ) ;
31
+ int i = 0 ;
32
+
33
+ while ( enumerator . MoveNext ( ) )
34
+ {
35
+ if ( enumerator . Current . Equals ( obj ) )
36
+ {
37
+ index = i ;
38
+ break ;
39
+ }
40
+
41
+ i ++ ;
42
+ }
43
+
44
+ return index ;
45
+ }
46
+
47
+ #if ! NETSTANDARD1_2 && ! NETSTANDARD1_3 && ! NETSTANDARD1_4
48
+ public static IEnumerable < DataRow > EnumerateRows ( this DataTable table )
49
+ {
50
+ foreach ( DataRow row in table . Rows )
51
+ {
52
+ yield return row ;
53
+ }
54
+ }
55
+ #endif
56
+ }
Original file line number Diff line number Diff line change @@ -37,5 +37,13 @@ public MaxLengthAttribute(int Length)
37
37
{
38
38
}
39
39
}
40
+
41
+ [ AttributeUsage ( AttributeTargets . Class ) ]
42
+ public class TableNameAttribute : Attribute
43
+ {
44
+ public TableNameAttribute ( string TableName )
45
+ {
46
+ }
47
+ }
40
48
}
41
49
}
You can’t perform that action at this time.
0 commit comments