Is it possible to have interfaces with other paramaters together like here below? I do this because I have private setters and have one constructor.
planning constructor (Logic)
public Planning(
IPlanningDAL planningDAL,
IPlanningParticipantDAL planningParticipantDAL,
ICategoryCollectionDAL categoryCollectionDAL,
ITaskCollectionDAL taskCollectionDAL,
ITaskDAL taskDAL,
IParticipantDAL participantDAL,
ICategoryDAL categoryDAL,
int id,
string name,
DateTime startDate,
DateTime? endDate,
Participant leader)
{
this.planningDAL = planningDAL;
this.planningParticipantDAL = planningParticipantDAL;
this.categoryCollectionDAL = categoryCollectionDAL;
this.taskCollectionDAL = taskCollectionDAL;
this.taskDAL = taskDAL;
this.participantDAL = participantDAL;
this.categoryDAL = categoryDAL;
Id = id;
Name = name;
StartDate = startDate;
EndDate = endDate;
Leader = leader;
}
ASP.NET Core MVC program
builder.Services.AddScoped<Planning>();
error
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Logic.Models.Planning Lifetime: Scoped ImplementationType: Logic.Models.Planning': Unable to resolve service for type 'System.Int32' while attempting to activate 'Logic.Models.Planning'.)
A question similar to your question asked before. I think the following link can help you .
Error while validating the service descriptor 'ServiceType: INewsRepository Lifetime: Singleton ImplementationType: NewsRepository':