I have no overload for EF files, and no receiving signals available

I am very confused, I am trying in vain to queue several attachments, I have thousands of add-ons to do this, I only want to do the database once.

I use .net 4 and the framework 4 framework, and also added a link to system.data.objects but I still have no overload for SaveChanges

here is my code:

        using (TransactionScope scope = new TransactionScope())
        {
            using (myDbContext context = new myDbContext)
            {

                foreach (var p in model)
                {
                    var tempProduct = new Products();
                    // set a loopable list of available products
                    IEnumerable<MerchantProductFeedMerchantProd> prod = p.prod;

                    foreach (var i in prod)
                    {
                        var prodText = i.text.FirstOrDefault();
                        var prodUri = i.uri.FirstOrDefault();
                        var prodPrice = i.price.FirstOrDefault();

                        FillTempProduct(feedId, i, tempProduct, supplierId, feedInfo, prodPrice, prodText,
                                        prodUri);


                            context.Products.Add(tempProduct);
                            context.SaveChanges(false); // no overload

                }


                scope.Complete();
                context.AcceptAllChanges(); //acceptallchanges not referenced ??

            }
        }

it really beats my head now, so any help would be greatly appreciated.

thank

+5
source share
1 answer

API DbContext, ObjectContext API. DbContext API = . , ObjectContext API, DbContext ObjectContext:

var objectContext = ((IObjectContextAdapter)myDbContext).ObjectContext;
+7

All Articles