Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Help for a use case #43

Copy link
Copy link

Description

@Loppone
Issue body actions

Hello,
i have a similar situation.
I was forced to create a IPerformer interface with parametrized methods because MyClass works with Ninject and i can't add more parameters other than bound interface to kernel.
My goal is to remove parameters to IPerformer methods and pass in some way to Myclass.
Factory could be the solution, but i can't figure how to do it.
Can someone drop me some lines of code, please?

public Interface IPerformer
{
	void Perform_A(int id, string name);
	void Perform_B(int id, string name);
	void Perform_C(int id, string name);
}


public MyClass : IPerformer
{
	private readonly IMapper _mapper;
	private readonly IManager _manager;

	public MyClass(IMapper mapper, IManager manager)
	{
		_mapper = mapper;
		_manager = manager;
	}

	public void Perform_A(int id, string name)
	{ 
		_manager.DoSomething_A(id, name);
	}

	public void Perform_B(int id, string name)
	{
		_manager.DoSomething_B(id, name);
	}

	public void Perform_C(int id, string name)
	{
		_manager.DoSomething_C(id, name);
	}
}

StackOverflow reference: My StackOverflow post

Thanks
Max

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.