Esempio n. 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);
 }
Esempio n. 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
             }
         };
 }
Esempio n. 3
0
 public ActionResult View(WidgetId id)
 {
     var viewModel = new WidgetViewViewModel(this.service.GetWidget(id));
     return this.View(viewModel);
 }
Esempio n. 4
0
 public ActionResult UpdateTitle(WidgetId id)
 {
     var viewModel = new WidgetUpdateTitleViewModel(this.service.GetWidget(id));
     return this.View(viewModel);
 }
Esempio n. 5
0
 public Widget(WidgetId id, string title, Price cost)
 {
     this.Id = id;
     this.Title = title;
     this.Price = cost;
 }