protected override void OnBeforeInsert(ItemsDetail info) { //留给子类对参数对象进行修改 info.Id = GuidUtils.CreateNo(); info.CreatorTime = DateTime.Now; info.CreatorUserId = CurrentUser.UserId; info.DeleteMark = false; if (info.SortCode == null) { info.SortCode = 99; } bool bltree = itemsService.Get(info.ItemId).IsTree; if (bltree) { if (string.IsNullOrEmpty(info.ParentId)) { info.Layers = 1; info.ParentId = ""; } else { info.Layers = iService.Get(info.ParentId).Layers + 1; } } else { info.ParentId = ""; } }
// Read by id public HttpResponseMessage Get(int id) { var item = _itemsService.Get(id); if (item == null) { Request.CreateResponse(HttpStatusCode.NotFound); } return(Request.CreateResponse(HttpStatusCode.OK, ItemViewModel.MapFromEntity(item))); }
public IHttpActionResult Get() { var model = LoadService.Get(1); model.Items = ItemsService.Get(model.Id); // return new HtmlActionResult("<b>Hello</b>"); return(new RazorActionResult("Dashboard", model)); }
public JsonResult Get(int id) { if (id < 1) { return(Json(new { message = "Товар не найден" })); } ItemsModel itemsModel = itemsService.Get(id); if (itemsModel == null) { return(Json(new { message = "Товар не найден" }));; } return(Json(new { message = itemsModel }));; }
public IActionResult Pobierz() { var items = itemsService.Get(); return(Ok(items)); }
public IActionResult Get() //GET - pobierz { return(Ok(_itemService.Get())); }
public async Task <Item> Get(int id) => await _memoryCache.GetOrCreateAsync( $"{_typeName}-Get-{id}", entry => _itemsService.Get(id));
private void Load() { Schema = schemasService.Get(1); Schema.Items = itemsService.Get(); }
public ActionResult <List <Item> > Get() => _itemsService.Get();
protected virtual void Load() { Items = itemsService.Get(); }