Beispiel #1
0
 public bool Equals(WidgetId other)
 {
     if (ReferenceEquals(null, other))
     {
         return false;
     }
     if (ReferenceEquals(this, other))
     {
         return true;
     }
     return other.Id.Equals(this.Id);
 }
Beispiel #2
0
 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
             }
         };
 }
Beispiel #3
0
 public ActionResult View(WidgetId id)
 {
     var viewModel = new WidgetViewViewModel(this.service.GetWidget(id));
     return this.View(viewModel);
 }
Beispiel #4
0
 public ActionResult UpdateTitle(WidgetId id)
 {
     var viewModel = new WidgetUpdateTitleViewModel(this.service.GetWidget(id));
     return this.View(viewModel);
 }
Beispiel #5
0
 public Widget(WidgetId id, string title, Price cost)
 {
     this.Id = id;
     this.Title = title;
     this.Price = cost;
 }