Related
R4nc1d In Autofac you can use RegisterAssemblyTypes to register your dependencies so you can do something like that, is there a way to do something like DIthis in builtins.net Core builder.RegisterAssemblyTypes(Assembly.Load("SomeProject.Data"))
.Where(t =
Kento Is it possible to get the dependencies on the fly by somehow getting a reference to the IServiceProvider or some class that can resolve the dependencies? For example, when handling exceptions to UseExceptionHandleroutput something meaningful to the clien
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Tony Joraz I need to inject everything I declare in the installer from the constructor. can i do it? How to inject service from constructor? Similar to the Injector service in Angular 2. Injected service without constructor in controller something like this
Palmy I have the following interfaces, abstract classes, etc. public interface IAggregateRootMapping<T> : IAggregateDefinition where T : AggregateRoot
{
IEnumerable<Expression<Func<T, object>>> IncludeDefinitions { get; }
}
public abstract class Aggregate
Kevin Brighton I am trying to do routing in ASP.NET Core 2.0. I have a class that wraps System.DateTime.UtcNowfunctionality (for simpler unit testing) public interface IDateTimeWrapper
{
DateTime UtcNow();
}
public sealed class DateTimeWrapper : IDateTime
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Lord Vermilion I am trying to understand dependency injection in ASP.NET MVC CORE. All examples are the same, they show to registerHttpContextAccessor public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton
Kento Is it possible to get the dependencies on the fly by somehow getting a reference to the IServiceProvider or some class that can resolve the dependencies? For example, when handling exceptions to UseExceptionHandleroutput something meaningful to the clien
urge I can figure out what's going on with the following line of code:- Why can't I use a singleton on it? services.AddSingleton<IProductRepository, ProductRepository>();
I'm getting a 500 Internal Server Error with the above code, but using Transientand work
R4nc1d In Autofac you can use RegisterAssemblyTypes to register your dependencies so you can do something like that, is there a way to do something like DIthis in builtins.net Core builder.RegisterAssemblyTypes(Assembly.Load("SomeProject.Data"))
.Where(t =
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Tony Joraz I need to inject everything I declare in the installer from the constructor. can i do it? How to inject service from constructor? Similar to the Injector service in Angular 2. Injected service without constructor in controller something like this
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Tony Joraz I need to inject everything I declare in the installer from the constructor. can i do it? How to inject service from constructor? Similar to the Injector service in Angular 2. Injected service without constructor in controller something like this
Renacre The following controllers handle usage operations such as registration. However, when I Registeruse axios to call the method in the controller, I get the following error. Failed to load resource: The server responded with a status of 500() However, if
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Mickey Using .NET Core 3.1, I developed an MVC application and deployed it on IIS 8.5. Using a browser, I can go to the home page when I visit, domain.com/myApp/but I get an http 500 error when I visit domain.com/myApp. This is working locally. The problem occ
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Tony Joraz I need to inject everything I declare in the installer from the constructor. can i do it? How to inject service from constructor? Similar to the Injector service in Angular 2. Injected service without constructor in controller something like this
Tony Joraz I need to inject everything I declare in the installer from the constructor. can i do it? How to inject service from constructor? Similar to the Injector service in Angular 2. Injected service without constructor in controller something like this
Chai Wei Jian In .net core, if I use dependency injection, do all constructor parameters have to be provided by DI? for example: public Person CreateClient()
{
string phone = "12345678";
return new Person(phoneNumber: phone);
}
public class Pe
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Bob 5421 I have read this official documentation : https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection . Something I don't understand in constructor injection: Let's take a look at my code, it works fine: public class HomeController
Lord Vermilion I am trying to understand dependency injection in ASP.NET MVC CORE. All examples are the same, they show to registerHttpContextAccessor public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton