Is there another way of declaring my ProductController for the logger that is being injected?
public class ProductController : Controller
{
private readonly LoggingInterface.ILogger<ProductController> _logger;
private readonly IProductRepository _productRepository;
public ProductController(LoggingInterface.ILogger<ProductController> logger, IProductRepository productRepository)
{
_logger = logger;
_productRepository = productRepository;
}
{
Thank you, Stephen
Generic Methods A type parameter, also known as a type variable, is an identifier that specifies a generic type name. The type parameters can be used to declare the return type and act as placeholders for the types of the arguments passed to the generic method, which are known as actual type arguments.
Generics enable the use of stronger type-checking, the elimination of casts, and the ability to develop generic algorithms. Without generics, many of the features that we use in Java today would not be possible.
Arguments object in JavaScript is an object, which represents the arguments to the function executing. Here is the difference between rest parameters and the arguments object. Arguments object includes all arguments passed to the function, whereas rest parameters are those, which are not given another name.
From the point of view of reflection, the difference between a generic type and an ordinary type is that a generic type has associated with it a set of type parameters (if it is a generic type definition) or type arguments (if it is a constructed type). A generic method differs from an ordinary method in the same way.
Inference requires the use of an open generic. There are none in this sample
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With