Hi to all
i wrote a module on dnn8 ,i used dnn service framework and petapoco for module datalayer.
i used the petapoco like below code:
PetaPoco.Database db = new PetaPoco.Database();
DotNetNuke.Data.PetaPoco.PetaPocoRepository<TrainingCenterInfo> ppr = new DotNetNuke.Data.PetaPoco.PetaPocoRepository<TrainingCenterInfo>(db,
PetaPoco.Mappers.GetMapper((new TrainingCenterInfo()).GetType()));
in first step or in first call this method is true and worked to fetch data!!!
but on over call above methode,i get the error,the error message is : An item with the same key has already been added.
and the logged error in Log viewer is :
AbsoluteURLReferrer:http://localhost:85/%D9%86%D8%B4%D8%B1%D8%B4%D9%87%D8%B1/tabid/105/ctl/AddStudent/mid/494/Default.aspx
UserAgent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:741f74e4-4241-4eb1-9685-4f612722c9d6
InnerException:An item with the same key has already been added.
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:System.Collections.Generic.Dictionary`2.Insert
StackTrace:
Message:
DotNetNuke.Services.Exceptions.PageLoadException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at PetaPoco.Mappers.RegisterInternal(Object typeOrAssembly, IMapper mapper)
at PetaPoco.Mappers.Register(Type type, IMapper mapper)
--- End of inner exception stack trace ---
Source:
Server Name : 002-PC
where is my mistak? and what do i do for use petapoco in my module?
Thanks for your attention's and your replay.