public void CreateUserInProduct(AdminUserManagementModel.CreateAdminAspUser model) { Core_UserProducts obj = new Core_UserProducts { ProductId = model.ProductId, UserId = model.UserAppId, }; ent.AddToCore_UserProducts(obj); ent.SaveChanges(); }
public void CheckExistanceofUserProduct(int UserId, int productid) { TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel(); var product = ent.Core_UserProducts.Where(xx => xx.UserId == UserId && xx.ProductId == productid).ToList(); if (product.Count() == 0) { Core_UserProducts obj = new Core_UserProducts { ProductId = productid, UserId = UserId, }; ent.AddToCore_UserProducts(obj); ent.SaveChanges(); } }