I would like to know how could i initate the BaseDao class ?
public class BaseDao<TEntity, TIdentifier>
where TIdentifier : new()
where TEntity : BaseVo<TIdentifier>
{
//has implementation
}
public class BaseVo<TIdentifier>
where TIdentifier : new()
{
/// <summary>
/// Gets or sets the Identifier.
/// </summary>
public virtual TIdentifier Id { get; set; }
}
I am trying to do
public BaseDao<Department, int> GetDepartmentRepository()
{
return new BaseDao<Department, int>();
}
But getting the error - Kindly help The type 'Domain.Models.Entities.Department' cannot be used as type parameter 'TEntity' in the generic type or method 'Domain.Models.BaseDao'. There is no implicit reference conversion from 'Domain.Models.Entities.Department' to 'Domain.Models.BaseVo'.
Aucun commentaire:
Enregistrer un commentaire