मुझे यह त्रुटि संदेश मिल रहा है जो मेरी जेनेरिक रिपोजिटरी से प्राप्त करने का प्रयास करते समय। त्रुटि कहती है कि मुझे एक संदर्भ भी प्रदान करने की आवश्यकता है, लेकिन मुझे यकीन नहीं है कि कैसे?कोई तर्क नहीं दिया गया है जो जेनेरिक रिपोजिटरी <Incident> के आवश्यक औपचारिक पैरामीटर के संदर्भ से मेल खाता है। जेनरिक रिपोजिटरी (डीबीकॉन्टेक्स्ट)
//IncidentRepository
public class IncidentRepository : GenericRepository<Incident>
//Generic Repository (to inherit from)
public class GenericRepository<TEntity> where TEntity : class
{
internal db_SLee_FYPContext context;
internal DbSet<TEntity> dbSet;
public GenericRepository(db_SLee_FYPContext context)
{
this.context = context;
this.dbSet = context.Set<TEntity>();
}
संपादित करें:
बस की जाँच करने के मैं इस समझा है?
public class IncidentRepository: GenericRepository<Incident>
{
public IncidentRepository(db_SLee_FYPContext context)
{
this.context = context;
}
//Then in my genric repository
public GenericRepository()
{
}
मैं सिर्फ अपने हादसा भंडार में एक डिफ़ॉल्ट निर्माता की आवश्यकता चाहिए लेकिन मैं अभी भी यह त्रुटि प्राप्त लेता है शामिल नहीं है किया जाएगा। – ASPCoder1450