This question is locked. New answers and comments are not allowed.
We did not find any demo application "WinForms" to find your site to run as a transaction:
Simple matter:
// Create a new category
Category newCategory = new Category()
{
CategoryName = "MyCategory",
Description = "Description"
};
dbContext.Add( newCategory );
// Update an existing category
---------------------------------------------------------------------------------------------------
If you want to edit or delete category just added to the transaction is not closed but we have no reference ?
-----------------------------------------------------------------------------------------------------
Category updateCategory = dbContext.Categories.Where( c => c.CategoryID == 1 ).First();
updateCategory.Description = "NewDescription";
// Delete an existing category
Category categoryToDelete = dbContext.Categories.Where( c => c.CategoryID == 2 ).First();
dbContext.Delete( categoryToDelete );
// Save Changes
dbContext.SaveChanges();
Simple matter:
// Create a new category
Category newCategory = new Category()
{
CategoryName = "MyCategory",
Description = "Description"
};
dbContext.Add( newCategory );
// Update an existing category
---------------------------------------------------------------------------------------------------
If you want to edit or delete category just added to the transaction is not closed but we have no reference ?
is updated on a category below CategoryID = 1 but in this context the value of this property is not generated upon where you reference?
Same question and delete ...
Same question and delete ...
Category updateCategory = dbContext.Categories.Where( c => c.CategoryID == 1 ).First();
updateCategory.Description = "NewDescription";
// Delete an existing category
Category categoryToDelete = dbContext.Categories.Where( c => c.CategoryID == 2 ).First();
dbContext.Delete( categoryToDelete );
// Save Changes
dbContext.SaveChanges();