public bool Equals(WidgetId other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return other.Id.Equals(this.Id); }
public WidgetDetail GetWidget(WidgetId id) { var widget = widgets.Single(x => x.Id.Id == id.Id); return new WidgetDetail { Id = widget.Id, Title = widget.Title, Price = new WidgetCreatorMvc3.Service.DTO.Price { Amount = widget.Price.Amount, Currency = widget.Price.Currency } }; }
public ActionResult View(WidgetId id) { var viewModel = new WidgetViewViewModel(this.service.GetWidget(id)); return this.View(viewModel); }
public ActionResult UpdateTitle(WidgetId id) { var viewModel = new WidgetUpdateTitleViewModel(this.service.GetWidget(id)); return this.View(viewModel); }
public Widget(WidgetId id, string title, Price cost) { this.Id = id; this.Title = title; this.Price = cost; }