Hi Experts,
I am regular user of NopCommerce but mostly i was working in previous version <1.7. But now i started nopCommerce 1.7 in 2010 VS.
1.
I added one table called :
tjq_users actually this was in my previous e-commerce.
Having Field Like:
public partial class tjq_Users : BaseEntity
{
public tjq_Users()
{
}
public int UserID { get; set; }
public int UserAccessLevel { get; set; }
public DateTime UserDateStamp { get; set; }
public bool UserValidated { get; set; }
public DateTime UserLastAccessDate { get; set; }
public bool UserActive { get; set; }
public DateTime UserExpirationDate { get; set; }
public bool UserNews { get; set; }
public bool UserMailingList { get; set; }
public DateTime UserSubscribeDate { get; set; }
public DateTime UserSubscribeCancelDate { get; set; }
public string UserSubscriptionDescription { get; set; }
public int UserSubscriptionTerm = 1;
public float UserMonthlyRate { get; set; }
public DateTime UserNextChargeDate { get; set; }
public float UserNextChargeAmount { get; set; }
public string UserEmailAddress { get; set; }
public string UserFirstName { get; set; }
public string UserLastName { get; set; }
public string UserPassword { get; set; }
public bool UserNotifyForumPostAll{get;set;}
public bool UserNotifyNews{get;set;}
public bool UserNotifyForumPostRelated{get;set;}
public bool UserNotifyBlogPost { get; set; }
public string UserNickName { get; set; }
public string UserReferralAffiliateID { get; set; }
public int UserReferralUserID { get; set; }
}
Its because i just want to store user information in both system from NopCommerce registration Form.
2. I did pull in the NopModel.edmx.
3. get inside of NopObjectContext.css and added following code:
public ObjectSet<tjq_Users> tjq_Users
{
get
{
if ((_tjq_Users == null))
{
_tjq_Users = CreateObjectSet<tjq_Users>();
}
return _tjq_Users;
}
}
private ObjectSet<tjq_Users> _tjq_Users;
4. I did call on CustomerManager.cs like below
var tjq = context.tjq_Users.CreateObject();
tjq.UserID = 0;
tjq.UserFirstName = "sunil";
tjq.UserLastName = "paudel";
tjq.UserEmailAddress = "[email protected]";
tjq.UserPassword = "password";
tjq.UserReferralAffiliateID = "aaaa";
tjq.UserNotifyForumPostAll = true;
tjq.UserNotifyNews = true;
tjq.UserNotifyForumPostRelated = true;
tjq.UserNotifyBlogPost = true;
tjq.UserNickName = "test name";
tjq.UserReferralUserID = 1;
tjq.UserAccessLevel = 0;
tjq.UserDateStamp = DateTime.Now;
tjq.UserValidated = true;
tjq.UserLastAccessDate = DateTime.Now;
tjq.UserActive = true;
tjq.UserExpirationDate = DateTime.Now.AddDays(300);
tjq.UserNews = false;
tjq.UserMailingList = false;
tjq.UserSubscribeDate = DateTime.Now;
tjq.UserSubscribeCancelDate = DateTime.Now.AddDays(300);
tjq.UserSubscriptionDescription = "teest";
tjq.UserSubscriptionTerm = 1;
tjq.UserMonthlyRate = 1010;
tjq.UserNextChargeDate = DateTime.Now.AddDays(300);
tjq.UserNextChargeAmount = 100;
context.tjq_Users.AddObject(tjq);
context.SaveChanges();
5. Finally i get following error
Mapping and metadata information could not be found for EntityType 'NopSolutions.NopCommerce.BusinessLogic.tjq_UsersManagement.tjq_Users'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Mapping and metadata information could not be found for EntityType 'NopSolutions.NopCommerce.BusinessLogic.tjq_UsersManagement.tjq_Users'.
Source Error:
Line 108: if ((_tjq_Users == null))
Line 109: {
Line 110: _tjq_Users = CreateObjectSet<tjq_Users>();
Line 111: }
Line 112: return _tjq_Users;
Source File: D:\Projects\NopCommerce\from client\test\Source\Libraries\Nop.BusinessLogic\Data\NopObjectContext.cs Line: 110
Mapping and metadata information could not be found for EntityType 'NopSolutions.NopCommerce.BusinessLogic.tjq_UsersManagement.tjq_Users'.
Thanks in Advance
Khem