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