diff --git a/src/Discord.Net.Commands/Attributes/InjectAttribute.cs b/src/Discord.Net.Commands/Attributes/InjectAttribute.cs deleted file mode 100644 index 09c0b553b..000000000 --- a/src/Discord.Net.Commands/Attributes/InjectAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Discord.Commands -{ - /// - /// Indicates that this property should be filled in by dependency injection. - /// - /// - /// This property **MUST** have a setter. - /// - [AttributeUsage(AttributeTargets.Property)] - public sealed class InjectAttribute : Attribute - { - } -} diff --git a/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs b/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs index 0bcb24882..1923734e7 100644 --- a/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs +++ b/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs @@ -43,21 +43,6 @@ namespace Discord.Commands try { T instance = (T)constructor.Invoke(args); - var fields = instance.GetType().GetRuntimeProperties().Where(p => p.GetCustomAttribute() != null).Where(p => p.CanWrite); - foreach (var field in fields) - { - object arg; - if (map == null || !map.TryGet(field.PropertyType, out arg)) - { - if (field.PropertyType == typeof(CommandService)) - arg = service; - else if (field.PropertyType == typeof(IDependencyMap)) - arg = map; - else - throw new InvalidOperationException($"Failed to inject \"{typeInfo.FullName}\", dependency \"{field.PropertyType.FullName}\" was not found."); - } - field.SetValue(instance, arg); - } return instance; } catch (Exception ex)