public string Buy(OrderModel model) { var customerId = _db.GetCustomerIdByName(model.CustomerName); if (customerId == null) { _db.AddCustomer(model.CustomerName); } customerId = _db.GetCustomerIdByName(model.CustomerName); var order = new Order { WhoreId = model.WhoreId, CustomerId = customerId }; _db.AddOrder(order); return("Ваш заказ принят"); }