Summary
Deprecate the [Event] attribute in favor of a new [FromEvent] attribute to align with ASP.NET Core conventions like [FromBody], [FromQuery], [FromRoute], etc.
Motivation
- Convention alignment: ASP.NET Core uses
[From*] naming pattern for parameter binding attributes
- Clarity: The
[From*] pattern makes it explicit where the parameter value comes from
- Consistency: Developers familiar with ASP.NET Core will recognize the pattern immediately
Tasks
Migration Example
// Old (deprecated)
public class MyHandler
{
public string Handle([Event] MyEvent evt) => evt.Message;
}
// New (recommended)
public class MyHandler
{
public string Handle([FromEvent] MyEvent evt) => evt.Message;
}
Breaking Change Considerations
This change should be introduced as non-breaking:
- Keep
[Event] working alongside [FromEvent]
- Mark as obsolete with compiler warning
- Remove in next major version (v2.0.0 or later)
Summary
Deprecate the
[Event]attribute in favor of a new[FromEvent]attribute to align with ASP.NET Core conventions like[FromBody],[FromQuery],[FromRoute], etc.Motivation
[From*]naming pattern for parameter binding attributes[From*]pattern makes it explicit where the parameter value comes fromTasks
[FromEvent]attribute with same functionality as[Event][Event]attribute as[Obsolete]with appropriate warning message[FromEvent][FromEvent][FromEvent]attributeMigration Example
Breaking Change Considerations
This change should be introduced as non-breaking:
[Event]working alongside[FromEvent]