public ActionResult Edit([Bind(Include = "Id,From,To,PricePerUnit")] ConsumptionRange range)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(range).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(range));
 }
 public ActionResult Create([Bind(Include = "Id,From,To,PricePerUnit")] ConsumptionRange range)
 {
     if (ModelState.IsValid)
     {
         _db.ConsumptionRanges.Add(range);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(Create(range));
 }
 public static string From(ConsumptionRange range)
 {
     return($"[{range.From};{range.To}] {range.PricePerUnit} UAH");
 }