Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: setting/"initializing" properties of returned instances #1434

Closed
Ultrahead opened this issue Apr 4, 2018 · 3 comments
Closed

Proposal: setting/"initializing" properties of returned instances #1434

Ultrahead opened this issue Apr 4, 2018 · 3 comments

Comments

@Ultrahead
Copy link

Currently, when you instantiate a class, you can set its properties this way:

var myService = new MyService()
{
  Property1 = true,
  ...
};

The idea is to extend this feature for situations like:

var myService = Factory.GetService<MyService>()
{
  Property1 = true,
  ...
};

For nullable types, ? could be used: Factory.GetService()? ...

@svick
Copy link
Contributor

svick commented Apr 4, 2018

This is a duplicate of #803, except for the nullable part.

@Ultrahead
Copy link
Author

I see. Maybe it could be merged?

@Ultrahead
Copy link
Author

I'm closing this thread given #803 and #1449.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants