Giter Club home page Giter Club logo

Comments (5)

artganify avatar artganify commented on September 25, 2024

Created a PR: #8

from autofac-serilog-integration.

nblumhardt avatar nblumhardt commented on September 25, 2024

Thank you for the PR! Not a scenario I'd given any thought to.

I'm a bit rusty on how the MEF integration works - would you be able to give a code sample showing how the updated API is used?

Regards,
Nick

from autofac-serilog-integration.

artganify avatar artganify commented on September 25, 2024

Using the updated api, I can register the logger like so:

builder.RegisterLogger(configureRegistration: x => x.Export());

That way, the logger is being declared as an export and I can inject it into a resolved MEF component using Autofac.

However I think it would be good idea to have this API generally, because if I'm going to register a component within my IoC, I want at least to be able to define how the component is being registered. Maybe I need a special lifetime? Maybe I want to provide additional metadata?

from autofac-serilog-integration.

nblumhardt avatar nblumhardt commented on September 25, 2024

Thanks for the follow-up! Makes sense.

It's a nice tidy PR, but given how small this project is I think it might be better in this case to grab the code and modify it in your own project. I'd like to keep the API of this one trivially simple, and I'm not sure exposing some of the implementation (i.e. generic arguments on IRegistrationBuilder<,,> will hold up over time. Would this work for you?

from autofac-serilog-integration.

artganify avatar artganify commented on September 25, 2024

Yup, works for me. I cannot say anything about the consequences of exposing the generic IRegistrationBuilder<,,>, so this is probably for the best.

Thank you for your time. :)

from autofac-serilog-integration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.