Exemplo n.º 1
0
        public Task <TResource> UpdateAsync <TResource>(TResource resourceToUpdate, object primaryKey)
            where TResource : class, IRestResource
        {
            IInMemoryRuntimeConfiguration <TResource> config = GetConfig <TResource>();

            return(Task.FromResult(config.UpdateEntry(resourceToUpdate, primaryKey.ToString())));
        }
Exemplo n.º 2
0
        public Task <IEnumerable <TResource> > SelectAllAsync <TResource>()
            where TResource : class, IRestResource
        {
            IInMemoryRuntimeConfiguration <TResource> config = GetConfig <TResource>();

            return(Task.FromResult(config.GetAllEntries()));
        }
Exemplo n.º 3
0
        public Task <TResource> SelectByIdAsync <TResource>(object primaryKey)
            where TResource : class, IRestResource
        {
            IInMemoryRuntimeConfiguration <TResource> config = GetConfig <TResource>();

            return(Task.FromResult(config.GetEntryByPrimaryKey(primaryKey.ToString())));
        }
Exemplo n.º 4
0
        public Task <TResource> InsertAsync <TResource>(TResource resourceToCreate)
            where TResource : class, IRestResource
        {
            IInMemoryRuntimeConfiguration <TResource> config = GetConfig <TResource>();

            return(Task.FromResult(config.InsertEntry(resourceToCreate)));
        }