所以我有一个通用方法
public virtual TPropType GetLocalized<TEntity, TPropType>(TEntity entity, Expression<Func<TEntity, TPropType>> keySelector,
int? languageId = null, bool returnDefaultValue = true, bool ensureTwoPublishedLanguages = true)
where TEntity : BaseEntity, ILocalizedEntity
我想将其转换为这样的内容:
public TPropType GetLocalized<TEntity, TPropType, T>(TEntity entity, Expression<Func<TEntity, T>> keySelector,
int? languageId = null, bool returnDefaultValue = true, bool ensureTwoPublishedLanguages = true)
where TEntity : IEntity<T>, ILocalizedEntity
我可以打这个电话 GetLocalized(设置,x => x.Id,languageId,returnDefaultValue,ensureTwoPublishedLanguages);
没有发生转换错误。
有人可以帮忙吗?