готово к сдаче
This commit is contained in:
parent
f8e9e27f73
commit
77e1d7924f
@ -65,8 +65,6 @@ namespace ComputersShopDataBaseImplement.Implements
|
||||
public OrderViewModel? Insert(OrderBindingModel model)
|
||||
{
|
||||
var newOrder = Order.Create(model);
|
||||
try
|
||||
{
|
||||
if (newOrder == null)
|
||||
{
|
||||
return null;
|
||||
@ -76,16 +74,6 @@ namespace ComputersShopDataBaseImplement.Implements
|
||||
|
||||
context.Orders.Add(newOrder);
|
||||
context.SaveChanges();
|
||||
}
|
||||
catch (DbUpdateException ex)
|
||||
{
|
||||
var innerException = ex.InnerException;
|
||||
while (innerException != null)
|
||||
{
|
||||
Console.WriteLine(innerException.Message);
|
||||
innerException = innerException.InnerException;
|
||||
}
|
||||
}
|
||||
return GetViewModel(newOrder);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user