public IApuxActionResult GetById(GetByIdAction action) { var product = _productDataAccess.GetProductById(action.Payload); if (product == null) { return(new ApuxActionResult <JToken>(new InternalErrorAction())); } else { return(new ApuxActionResult <Product>(product)); } }
public TEntity Get <TEntity>(object id) where TEntity : class { TEntity entity = default(TEntity); if (this.disposed) { return(entity); } this._metadataStore.AddEntity(typeof(TEntity)); var getByIdAction = new GetByIdAction <TEntity>(this._metadataStore, null, this._hydrator, this._connection, this._dialect, this._environment); entity = getByIdAction.GetById(id); this.InspectForLazyLoading(entity); this._sessionCache.Save <TEntity>(entity, id); return(entity); }
public async Task <Thingie> GetById([FromBody] GetByIdAction byId) { return(await thingies.FindByIdAsync(byId.Id)); }