Beispiel #1
0
 public async Task Delete(string typeIdentifier, [FromBody] object obj)
 {
     var type     = schemaRegistry.GetTypeByTypeIdentifier(typeIdentifier);
     var schema   = schemaRegistry.GetSchemaByTypeIdentifier(typeIdentifier);
     var typeInfo = TypeInfoExtractor.Extract(type, schema.PropertyDescriptionBuilder, schema.CustomPropertyConfigurationProvider);
     var x        = ObjectsConverter.ApiToStored(typeInfo, type, obj, schema.CustomPropertyConfigurationProvider);
     await schemaRegistry.GetConnector(typeIdentifier).Delete(x).ConfigureAwait(false);
 }
Beispiel #2
0
        public Task DeleteObject([NotNull] string objectIdentifier, [NotNull][FromBody] object obj)
        {
            var type     = schemaRegistry.GetTypeByTypeIdentifier(objectIdentifier);
            var schema   = schemaRegistry.GetSchemaByTypeIdentifier(objectIdentifier);
            var typeInfo = TypeInfoExtractor.Extract(type, schema.PropertyDescriptionBuilder, schema.CustomPropertyConfigurationProvider);
            var x        = ObjectsConverter.ApiToStored(typeInfo, type, obj, schema.CustomPropertyConfigurationProvider);

            return(schemaRegistry.GetConnector(objectIdentifier).Delete(x));
        }
Beispiel #3
0
        public async Task <object> UpdateObject([NotNull] string objectIdentifier, [NotNull][FromBody] object obj)
        {
            var type      = schemaRegistry.GetTypeByTypeIdentifier(objectIdentifier);
            var schema    = schemaRegistry.GetSchemaByTypeIdentifier(objectIdentifier);
            var typeInfo  = TypeInfoExtractor.Extract(obj, type, schema.PropertyDescriptionBuilder, schema.CustomPropertyConfigurationProvider);
            var stored    = ObjectsConverter.ApiToStored(typeInfo, type, obj, schema.CustomPropertyConfigurationProvider);
            var newObject = await schemaRegistry.GetConnector(objectIdentifier).Write(stored).ConfigureAwait(false);

            return(ObjectsConverter.StoredToApi(typeInfo, type, newObject, schema.CustomPropertyConfigurationProvider));
        }