Exemplo n.º 1
0
        public ResourceDefinition <T> Register()
        {
            var rd = new ResourceDefinition <T>()
            {
                Name        = _name,
                Filter      = _filter,
                CanWrite    = _canWrite,
                Includes    = _includes,
                OnDestroy   = _onDestroy,
                DsRelations = _relations
            };

            _dataStore.DefineResource(rd);
            return(rd);
        }
Exemplo n.º 2
0
 public void DefineResource <TEntity>(ResourceDefinition <TEntity> def) where TEntity : class
 {
     def.Name = (string.IsNullOrWhiteSpace(def.Name) ? typeof(TEntity).Name : def.Name).ToLower();
     _definitions[def.Name] = def;
     def.Ds = this;
 }