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));
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public async Task <Thingie> GetById([FromBody] GetByIdAction byId)
 {
     return(await thingies.FindByIdAsync(byId.Id));
 }