public ActionResult Details(int?id) { Infor infor = inforRepo.Get(i => i.ID == id); if (infor == null) { return(HttpNotFound()); } return(View(infor)); }
public ActionResult Details(int?id) { Member member = memberRepo.Get(m => m.ID == id); if (member == null) { return(HttpNotFound()); } return(View(member)); }
public ActionResult Edit(int?id) { if (id == null) { throw new ArgumentNullException("id"); } Feature feature = featRepo.Get(f => f.ID == id); if (feature == null) { return(HttpNotFound()); } return(View(feature)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LogRecord logRecord = logRecRepo.Get(r => r.ID == id); if (logRecord == null) { return(HttpNotFound()); } return(View(logRecord)); }
public ActionResult Index() { ExportService <LogRecord> exportService = new ExportService <LogRecord>(); ViewBag.ExportColumns = exportService.GetSelectList(); string user = WebSiteHelper.UserName; ViewBag.Title = user; if (user == "admin") { ViewBag.Title = "會員"; return(View(logRecRepo.GetAll())); } int memberId = memberRepo.Get(m => m.Name == user).ID; return(View(logRecRepo.GetAll().Where(r => r.MemberId == memberId).ToList())); }
private T GetFirst <T>() where T : EntityBase { var crud = new CrudRepository <T>(_uow); return(crud.Get().FirstOrDefault()); }
public static async Task GetRecord() { var record = await repo.Get(1); }