Example #1
0
        public async Task<IActionResult> Put(Put.Command command)
        {
            var result = await _mediator.SendAsync(command);

            if (result == null)
            {
                return NotFound();
            }

            return await Get(new Get.Query {Id = result.DocumentId});
        }
Example #2
0
 static WmiNetUtilsHelper()
 {
     myDllPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + "\\wminet_utils.dll";
     IntPtr procAddr = IntPtr.Zero;
     IntPtr loadLibrary = IntPtr.Zero;
     loadLibrary =  LoadLibrary(myDllPath);
     if( loadLibrary != IntPtr.Zero)
     {
         procAddr = GetProcAddress(loadLibrary, "ResetSecurity");
         if( procAddr != IntPtr.Zero)
         {
             ResetSecurity_f  =(ResetSecurity) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ResetSecurity));
         }
         procAddr = GetProcAddress(loadLibrary, "SetSecurity");
         if( procAddr != IntPtr.Zero)
         {
             SetSecurity_f  =(SetSecurity) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SetSecurity));
         }
         procAddr = GetProcAddress(loadLibrary, "BlessIWbemServices");
         if( procAddr != IntPtr.Zero)
         {
             BlessIWbemServices_f  =(BlessIWbemServices) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BlessIWbemServices));
         }
         procAddr = GetProcAddress(loadLibrary, "BlessIWbemServicesObject");
         if( procAddr != IntPtr.Zero)
         {
             BlessIWbemServicesObject_f  =(BlessIWbemServicesObject) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BlessIWbemServicesObject));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyHandle");
         if( procAddr != IntPtr.Zero)
         {
              GetPropertyHandle_f27=(GetPropertyHandle) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyHandle));
         }
         procAddr = GetProcAddress(loadLibrary, "WritePropertyValue");
         if( procAddr != IntPtr.Zero)
         {
              WritePropertyValue_f28=(WritePropertyValue) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(WritePropertyValue));
         }
         procAddr = GetProcAddress(loadLibrary, "Clone");
         if( procAddr != IntPtr.Zero)
         {
              Clone_f12=(Clone) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Clone));
         }   
         procAddr = GetProcAddress(loadLibrary, "VerifyClientKey");
         if( procAddr != IntPtr.Zero)
         {
              VerifyClientKey_f  =(VerifyClientKey) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(VerifyClientKey));
         }
         procAddr = GetProcAddress(loadLibrary, "GetQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetQualifierSet_f  =(GetQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "Get");
         if( procAddr != IntPtr.Zero)
         {
             Get_f  =(Get) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Get));
         }
         procAddr = GetProcAddress(loadLibrary, "Put");
         if( procAddr != IntPtr.Zero)
         {
             Put_f  =(Put) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Put));
         }
         procAddr = GetProcAddress(loadLibrary, "Delete");
         if( procAddr != IntPtr.Zero)
         {
             Delete_f  =(Delete) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Delete));
         }
         procAddr = GetProcAddress(loadLibrary, "GetNames");
         if( procAddr != IntPtr.Zero)
         {
             GetNames_f  =(GetNames) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetNames));
         }
         procAddr = GetProcAddress(loadLibrary, "BeginEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             BeginEnumeration_f  =(BeginEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BeginEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "Next");
         if( procAddr != IntPtr.Zero)
         {
             Next_f  =(Next) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Next));
         }
         procAddr = GetProcAddress(loadLibrary, "EndEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             EndEnumeration_f  =(EndEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(EndEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetPropertyQualifierSet_f  =(GetPropertyQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "Clone");
         if( procAddr != IntPtr.Zero)
         {
             Clone_f  =(Clone) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Clone));
         }
         procAddr = GetProcAddress(loadLibrary, "GetObjectText");
         if( procAddr != IntPtr.Zero)
         {
             GetObjectText_f  =(GetObjectText) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetObjectText));
         }
         procAddr = GetProcAddress(loadLibrary, "SpawnDerivedClass");
         if( procAddr != IntPtr.Zero)
         {
             SpawnDerivedClass_f  =(SpawnDerivedClass) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SpawnDerivedClass));
         }
         procAddr = GetProcAddress(loadLibrary, "SpawnInstance");
         if( procAddr != IntPtr.Zero)
         {
             SpawnInstance_f  =(SpawnInstance) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SpawnInstance));
         }
         procAddr = GetProcAddress(loadLibrary, "CompareTo");
         if( procAddr != IntPtr.Zero)
         {
             CompareTo_f  =(CompareTo) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CompareTo));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyOrigin");
         if( procAddr != IntPtr.Zero)
         {
             GetPropertyOrigin_f  =(GetPropertyOrigin) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyOrigin));
         }
         procAddr = GetProcAddress(loadLibrary, "InheritsFrom");
         if( procAddr != IntPtr.Zero)
         {
             InheritsFrom_f  =(InheritsFrom) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(InheritsFrom));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethod");
         if( procAddr != IntPtr.Zero)
         {
             GetMethod_f  =(GetMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "PutMethod");
         if( procAddr != IntPtr.Zero)
         {
             PutMethod_f  =(PutMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "DeleteMethod");
         if( procAddr != IntPtr.Zero)
         {
             DeleteMethod_f  =(DeleteMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(DeleteMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "BeginMethodEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             BeginMethodEnumeration_f  =(BeginMethodEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BeginMethodEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "NextMethod");
         if( procAddr != IntPtr.Zero)
         {
             NextMethod_f  =(NextMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(NextMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "EndMethodEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             EndMethodEnumeration_f  =(EndMethodEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(EndMethodEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethodQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetMethodQualifierSet_f  =(GetMethodQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethodQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethodOrigin");
         if( procAddr != IntPtr.Zero)
         {
             GetMethodOrigin_f  =(GetMethodOrigin) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethodOrigin));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Get");
         if( procAddr != IntPtr.Zero)
         {
              QualifierGet_f=(QualifierSet_Get) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Get));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Put");
         if( procAddr != IntPtr.Zero)
         {
              QualifierPut_f=(QualifierSet_Put) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Put));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Delete");
         if( procAddr != IntPtr.Zero)
         {
              QualifierDelete_f=(QualifierSet_Delete) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Delete));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_GetNames");
         if( procAddr != IntPtr.Zero)
         {
              QualifierGetNames_f=(QualifierSet_GetNames) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_GetNames));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_BeginEnumeration");
         if( procAddr != IntPtr.Zero)
         {
              QualifierBeginEnumeration_f=(QualifierSet_BeginEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_BeginEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Next");
         if( procAddr != IntPtr.Zero)
         {
              QualifierNext_f=(QualifierSet_Next) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Next));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_EndEnumeration");
         if( procAddr != IntPtr.Zero)
         {
              QualifierEndEnumeration_f=(QualifierSet_EndEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_EndEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetCurrentApartmentType");
         if( procAddr != IntPtr.Zero)
         {
             GetCurrentApartmentType_f  =(GetCurrentApartmentType) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetCurrentApartmentType));
         }
         procAddr = GetProcAddress(loadLibrary, "GetDemultiplexedStub");
         if( procAddr != IntPtr.Zero)
         {
              GetDemultiplexedStub_f =(GetDemultiplexedStub) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetDemultiplexedStub));
         }         
         procAddr = GetProcAddress(loadLibrary, "CreateInstanceEnumWmi");
         if( procAddr != IntPtr.Zero)
         {
             CreateInstanceEnumWmi_f  =(CreateInstanceEnumWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CreateInstanceEnumWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "CreateClassEnumWmi");
         if( procAddr != IntPtr.Zero)
         {
             CreateClassEnumWmi_f  =(CreateClassEnumWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CreateClassEnumWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "ExecQueryWmi");
         if( procAddr != IntPtr.Zero)
         {
             ExecQueryWmi_f  =(ExecQueryWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ExecQueryWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "ExecNotificationQueryWmi");
         if( procAddr != IntPtr.Zero)
         {
             ExecNotificationQueryWmi_f  =(ExecNotificationQueryWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ExecNotificationQueryWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "PutInstanceWmi");
         if( procAddr != IntPtr.Zero)
         {
             PutInstanceWmi_f  =(PutInstanceWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutInstanceWmi));
         } 
         procAddr = GetProcAddress(loadLibrary, "PutClassWmi");
         if( procAddr != IntPtr.Zero)
         {
             PutClassWmi_f  =(PutClassWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutClassWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "CloneEnumWbemClassObject");
         if( procAddr != IntPtr.Zero)
         {
             CloneEnumWbemClassObject_f  =(CloneEnumWbemClassObject) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CloneEnumWbemClassObject));
         }
         procAddr = GetProcAddress(loadLibrary, "ConnectServerWmi");
         if( procAddr != IntPtr.Zero)
         {
             ConnectServerWmi_f  =(ConnectServerWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ConnectServerWmi));
         }
         
     }
 }