I got this error in handler StorageFilter

Topics: Customizing Orchard
Dec 26, 2012 at 1:50 AM

Error 1 The type 'ERP.Purchasing.Models.PurchasingRequestPartRecord' cannot be used as type parameter 'TRecord' in the generic type or method 'Orchard.ContentManagement.Handlers.StorageFilter.For<TRecord>(Orchard.Data.IRepository<TRecord>)'. There is no implicit reference conversion from 'ERP.Purchasing.Models.PurchasingRequestPartRecord' to 'Orchard.ContentManagement.Records.ContentPartRecord'. C:\Users\admin\Desktop\Orchard\ERP\src\Orchard.Web\Modules\ERP.Purchasing\Handlers\PurchasingRequestHandler.cs 10 25 ERP.Purchasing

 

using ERP.Purchasing.Models;

using Orchard.ContentManagement.Handlers;

using Orchard.Data;

namespace ERP.Purchasing.Handlers{ 

  public class PurchasingRequestHandler : ContentHandler    {   

    public PurchasingRequestHandler(IRepository<PurchasingRequestPartRecord> repository)        {            Filters.Add(StorageFilter.For(repository));       

}   

}

}

Developer
Dec 26, 2012 at 10:01 AM

Did you make sure that your PurchasingRequestPartRecord class derives from ContentPartRecord?