I have one API projects with all endpoints and once ClassLibrary which holds all Dtos(model properties). Api projects have reference to ClassLibraray(Common). Actually I want to implement IValidatableObject for my Dtos to validate against the data in DB in classLibraray. For that I need to call Servicees which are available in the API projetcs. I cant refer API to Common(ClassLibraray) projects as its causing circular dependency. I am trying to resolve CD using Interface in newly created classlibraray but no luck. Anyone who can help me here with the solutions would be great. Thank you.
I have tried making Dtos class as partial and one same partial class in API but no luck. Also I am trying to inherit that model in the API with IValidatableObject but that not helping though PFB how I am trying using inheritance in API sulution
public class DepartmentDto : CreateDepartmentDto, IValidatableObject {