簡単な SQL の質問があります。私の MVC Razor アプリケーションでは、開始値と終了値を求める 2 つのテキスト入力があります。
これらの値は数値で、バージョン Ex: 4.0.100 - 4.0.157 に対応します。
したがって、100 から 157 までのすべてのバージョンを表示する必要があります。データベースに直接アクセスでき、それがバージョン列です。
私の質問は次のとおりです。これを表示するクエリを作成または取得するにはどうすればよいですか?
モデル:
using System;
using System.Collections.Generic;
namespace BenchmarkApp.Models
{
public partial class Build
{
public Build()
{
this.Executions = new List<Execution>();
}
public string Version { get; set; }
public bool Obfuscated { get; set; }
public bool Release { get; set; }
public int ID { get; set; }
public bool IsX64 { get; set; }
public bool Visible { get; set; }
public Nullable<System.DateTime> CreationDate { get; set; }
public virtual ICollection<Execution> Executions { get; set; }
}
}
2 つの入力を示すビュー .cshtml:
<td>
Viewing Option: @Html.DropDownList("ViewOption", (IEnumerable<SelectListItem>)ViewBag.ViewSelect, new { @onchange = "submit()" })
</td>
<td>
@if (ViewBag.RangeVisible == true)
{
@Html.Label("Range: ");
@Html.TextBox("start", "Start", new { maxlength = 10, size = 10 });
@Html.TextBox("end", "End", new { maxlength = 10, size = 10, @onchange = "submit()" });
}
テキスト入力にアクセスするコントローラ クラス:
string start = form["start"];
string end = form["end"];
string custom = form["customRange"];
string viewSelect = form["ViewOption"];
if (viewSelect.Equals("range"))
{
ViewBag.RangeVisible = true;
}
前もって感謝します!