public virtual Order ToEntity(int customerId) { var order = new Order { CustomerId = customerId, Description = Description, Amount = Amount }; return order; }
public override Order ToEntity(int orderId) { var order = new Order { Id = orderId, CustomerId = CustomerId, Description = Description, Amount = Amount }; return order; }
public IHttpActionResult Delete(int customerId, int orderId) { var entity = new Order(orderId, customerId); var serviceResult = _service.Remove(entity); if (serviceResult.Success) { return NoContent(); } return NotFound(); }
public override ServiceResult<Order> Update(Order order) { var result = new ServiceResult<Order>(); if (ThrowError) { result.AddModelError("", "Fake Error"); } else { result.Entity = order; result.Entity.OrderId = 1; } return result; }
public CreateOrderViewModel(Order order) { CustomerId = order.CustomerId; Description = order.Description; Amount = order.Amount; }
public UpdateOrderViewModel(Order order) : base(order) { OrderId = order.Id; }