我正在深入研究仿制药,现在我需要帮助.我在下面的'Derived'类中遇到编译错误,如主题标题所示.我看到很多其他类似的帖子,但我没有看到这种关系.有人能告诉我如何解决这个问题吗?
using System;
using System.Collections.Generic;
namespace Example
{
public class ViewContext
{
ViewContext() { }
}
public interface IModel
{
}
public interface IView<T> where T : IModel
{
ViewContext ViewContext { get; set; }
}
public class SomeModel : IModel
{
public SomeModel() { }
public int ID { get; set; }
}
public class Base<T> where T : IModel
{
public Base(IView<T> view)
{
}
}
public class Derived<SomeModel> : Base<SomeModel> where SomeModel : IModel
{
public Derived(IView<SomeModel> …Run Code Online (Sandbox Code Playgroud)