private void CheckProperty(CommonProperty property) { if (property.IsInheritedFrom(typeof(ICommand))) { const string errorMessage = "Patching property type cannot be inherited from ICommand"; log.Error(errorMessage); throw new PropertyPatchingException(errorMessage, property.FullName); } // ReSharper disable once InvertIf if (char.IsLower(property.Name.First())) { const string errorMessage = "First character of property name must be to upper case"; log.Error(errorMessage); throw new PropertyPatchingException(errorMessage, property.FullName); } }
public static bool IsNotInheritedFrom(this CommonProperty commonProperty, Type type) { return(!commonProperty.IsInheritedFrom(type)); }