I want to create a custom attribute that can be used on a property like:
[TrimInputString] public string FirstName { get; set; }
that will
As Matti pointed out, this is not how attributes work. However, you could use the PostSharp AOP framework to accomplish this, probably overriding OnMethodBoundaryAspect. But this is not trivial.