title: nopCommerce inserting entity fail
body: <p>I'm creating import from XML function for categories.
  First of all, using XDocument, I create list of categories to be added. I turned off isIdentity option for ID in Categories table, because I'm planning to use ID from XML.</p>
  
  <p>XML example:</p>
  
  <pre><code>&lt;cat&gt;
  &lt;id&gt;17&lt;/id&gt;
  &lt;name&gt;Category name&lt;/name&gt;
  &lt;parent_id&gt;0&lt;/parent_id&gt;
  &lt;/cat&gt;
  </code></pre>
  
  <p>Then, I wrote method, which tries to get category by ID and update, or insert new:</p>
  
  <pre><code>var category = _categoryService.GetCategoryById(Id);
          if (category != null)
          {
              category.Name = model.Name;
              category.ParentCategoryId = model.ParentCategoryId;
              category.UpdatedOnUtc = DateTime.UtcNow;
              category.Published = true;
              category.Deleted = false;
  
              _categoryService.UpdateCategory(category);
          }
          else
          {
              category = new Core.Domain.Catalog.Category();
  
              category.Id = model.Id;
              category.ParentCategoryId = model.ParentCategoryId;
              category.Name = model.Name;
              category.UpdatedOnUtc = DateTime.UtcNow;
              category.CreatedOnUtc = DateTime.UtcNow;
              category.Published = true;
              category.Deleted = false;
  
              _categoryService.InsertCategory(category);
          }
  </code></pre>
  
  <p>And then comes the most weird - application throws exception: Cannot insert the value NULL into column 'Id', table 'nopCommerce.dbo.Category'; column does not allow nulls. INSERT fails.
  The statement has been terminated.
  BUT even in debugger, category ID is not null.. Asking for help!
  Thanks in advance!</p>
  
  <p>Update: InsertCategory is a standard nopCommerce method:</p>
  
  <pre><code> /// &lt;summary&gt;
      /// Inserts category
      /// &lt;/summary&gt;
      /// &lt;param name="category"&gt;Category&lt;/param&gt;
      public virtual void InsertCategory(Category category)
      {
          if (category == null)
              throw new ArgumentNullException("category");
  
          _categoryRepository.Insert(category);
  
          //cache
          _cacheManager.RemoveByPattern(CATEGORIES_PATTERN_KEY);
          _cacheManager.RemoveByPattern(PRODUCTCATEGORIES_PATTERN_KEY);
  
          //event notification
          _eventPublisher.EntityInserted(category);
      }
  </code></pre>