diff --git a/README.md b/README.md index b88921f..754a8eb 100644 --- a/README.md +++ b/README.md @@ -72,19 +72,19 @@ Example: ```c# class CSVDataWithAttributes { - [Kafa("date")] + [KafaColumn("date")] public DateTime Date { get; set; } - [Kafa(1)] + [KafaColumn(1)] public double Open { get; set; } - [Kafa(2)] + [KafaColumn(2)] public double High { get; set; } - [Kafa(3)] + [KafaColumn(3)] public double Low { get; set; } - [Kafa(4)] + [KafaColumn(4)] public double Close { get; set; } - [Kafa(5)] + [KafaColumn(5)] public int Volume { get; set; } - [Kafa("name")] + [KafaColumn("name")] public string Name { get; set; } } ``` diff --git a/src/Kafa/KafaAttribute.cs b/src/Kafa/KafaColumnAttribute.cs similarity index 82% rename from src/Kafa/KafaAttribute.cs rename to src/Kafa/KafaColumnAttribute.cs index b6aa707..3b6ac69 100644 --- a/src/Kafa/KafaAttribute.cs +++ b/src/Kafa/KafaColumnAttribute.cs @@ -6,7 +6,7 @@ namespace nyingi.Kafa { [System.AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple =false)] - public class KafaAttribute : Attribute + public class KafaColumnAttribute : Attribute { public readonly string FieldName; public readonly int FieldIndex; @@ -14,7 +14,7 @@ public class KafaAttribute : Attribute /// Name of the Column to be matched with /// /// - public KafaAttribute(string fieldName) + public KafaColumnAttribute(string fieldName) { FieldName = fieldName; } @@ -23,7 +23,7 @@ public KafaAttribute(string fieldName) /// Index of the Column starting from 0 to N-1 /// /// - public KafaAttribute(int index) + public KafaColumnAttribute(int index) { FieldIndex = index; } diff --git a/src/Kafa/Reflection/KafaReflection.cs b/src/Kafa/Reflection/KafaReflection.cs index 15ee201..1403750 100644 --- a/src/Kafa/Reflection/KafaReflection.cs +++ b/src/Kafa/Reflection/KafaReflection.cs @@ -21,7 +21,7 @@ public KafaReflection(KafaTypeInfo typeInfo, OrderedDictionary Headers = default { if(Headers != null) { - var kafa = property.GetCustomAttribute(false); + var kafa = property.GetCustomAttribute(false); if (kafa != null) { diff --git a/src/KafaTests/KafaReadToTypeTests.cs b/src/KafaTests/KafaReadToTypeTests.cs index 78a81b5..a4c68d0 100644 --- a/src/KafaTests/KafaReadToTypeTests.cs +++ b/src/KafaTests/KafaReadToTypeTests.cs @@ -13,19 +13,19 @@ class CsvData class CSVDataWithAttributes { - [Kafa("date")] + [KafaColumn("date")] public DateTime Date { get; set; } - [Kafa(1)] + [KafaColumn(1)] public double Open { get; set; } - [Kafa(2)] + [KafaColumn(2)] public double High { get; set; } - [Kafa(3)] + [KafaColumn(3)] public double Low { get; set; } - [Kafa(4)] + [KafaColumn(4)] public double Close { get; set; } - [Kafa(5)] + [KafaColumn(5)] public int Volume { get; set; } - [Kafa("name")] + [KafaColumn("name")] public string Name { get; set; } } public class KafaReadToTypeTests