Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. using (var catalog = new DataCatalog())
  2. {
  3. var retailSaleReturn = new RetailSaleReturn
  4. {
  5. ReturnQuantity = returnQuantity,
  6. Product = saleDetailObj.Product,
  7. Owner = owner,
  8. Provider = provider,
  9. };
  10.  
  11. //add to context
  12. Catalog.RetailSaleReturns.Add(retailSaleReturn);
  13.  
  14. //save for db
  15. Catalog.SaveChanges();
  16. }
  17.  
  18. {"An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details."}
  19.  
  20. {"Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again."}
  21.  
  22. at System.Data.Entity.Internal.InternalContext.SaveChanges()
  23. at PawLoyalty.Data.Repositories.CustomersRepository.ReturnRetailOnlySales(Guid saleDetailId, Int32 returnQuantity, String providerKey, String ownerKey) in D:PawLoyalty ModulePawLoyaltyPawLoyaltyPawLoyalty.DataRepositoriesCustomersRepository.cs:line 550
  24. at PawLoyalty.Web.Areas.Providers.Controllers.CustomersController.ReturnRetailOnlySales(String providerKey, String ownerKey, String petKey, Guid saleDetailId, Int32 returnQuantity) in D:PawLoyalty ModulePawLoyaltyPawLoyaltyPawLoyalty.WebAreasProvidersControllersCustomersController.cs:line 942
  25. at lambda_method(Closure , ControllerBase , Object[] )
  26. at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
  27. at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
  28. at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
  29. at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
  30.  
  31. Add-AzureAccount
  32. Switch-AzureMode -Name AzureResourceManager
  33. Get-AzureSqlServer -ServerName '<<yoursqlservername>>' -ResourceGroupName '<<sqlserverresourcegroupname>>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement