Skip to content

Dependency v3.0 #61

@andreise

Description

@andreise

Renaming methods

Intro

Each of Dependency<T>..Dependency<T1, T2, T3, T4, T5, T6, T7, TRest> has following overloads of With methods like this (using Dependency<T> as an example):

  1. Dependency<T, T2 ...> With<T2 ...>(T2 second ...) // corresponds to Dependency<T>.Of(...) factories
  2. Dependency<T, T2 ...> With<T2 ...>(Dependency<T2 ...> other)
  3. Dependency<T, T2 ...> With<T2 ...>(Func<T2> second ...) // corresponds to Dependency<T>.From(Func<T2> second ...) factories
  4. Dependency<T, T2 ...> With<T2 ...>(Func<IServiceProvider, T2> second ...) // corresponds to Dependency<T>.From(Func<IServiceProvider, T2> second ...) factories

What to do

  1. For each Dependency<...> rename all the With<T2 ...>(T2 second ...) methods to Add (as corresponding to the Of factories).
    Keep the old With methods as wrappers of the new Add methods (directly, without creation of the inner implementation), and deprecate the old methods with "This method is obsolete. Call Add instead." message and the error set.
  2. For each Dependency<...> rename all the With<T2 ...>(Dependency<T2 ...> other) methods to Concat.
    Rename the corresponding InnerWith to InnerConcat.
    Keep the old With methods as wrappers of the new InnerConcat methods (with keeping validation of the arguments for null), and deprecate the old methods with "This method is obsolete. Call Concat instead." message and the error set.
  3. Copy-paste the tests of the obsolete methods to test the new methods. Mark the obsoletes' methods as obsolete to allow their compilation.

.NET targets

Remove .NET 7.0 target

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions