private static FormUrlEncodedContent ToContent( IPasswordedDemonizedProcess model ) => new FormUrlEncodedContent(
     new[] { 
         new KVP( nameof( model.Key ), model.Key ), new KVP( nameof( model.Arguments ), model.Arguments ), new KVP( nameof( model.Name ), model.Name ),
         new KVP( nameof( model.Path ), model.Path ), new KVP( nameof( model.Id ), model.Id.ToString( CultureInfo.InvariantCulture ) ),
         new KVP( nameof( model.Autorestart ), model.Autorestart.ToString( CultureInfo.InvariantCulture ) ),
         new KVP( nameof( model.Priority ), model.Priority.ToString() ),
         new KVP( nameof( model.HideOnStart ), model.HideOnStart.ToString( CultureInfo.InvariantCulture ) )
     } );
 public async Task Edit( IPasswordedDemonizedProcess model ) {
     if ( model == null ) {
         throw new ArgumentNullException(nameof( model ));
     }
     var existing = await _processRepository.Get( model.Id ).ConfigureAwait( false );
     await _processRepository.Edit(model).ConfigureAwait( false );
     //todo: update model
 }
 public async Task<int> Create( IPasswordedDemonizedProcess model ) {
     //i'm too lazy too implement it correctly(guids and stuff) but locking helps a little
     lock (locker) {
         try {
             var insert = MappingHelper.Instance.Map<IPasswordedDemonizedProcess, InternalDemonizedProcess>( model ); //todo: actual mapping
             insert.Id = NextId();
             if ( insert.Priority == 0 )
                 insert.Priority = System.Diagnostics.ProcessPriorityClass.Normal;
             _processes.Add(insert.Id, insert);
             Save();
             return insert.Id;
         }
         catch (Exception ex) {
             Console.WriteLine( ex );
             return -1;
         }
     }
 }
 public async Task Edit( IPasswordedDemonizedProcess model ) {
     var existing = GetInternal( model.Id );
     MappingHelper.Instance.Map<IPasswordedDemonizedProcess, InternalDemonizedProcess>( model, existing );
 }
 public async Task<int> Create( IPasswordedDemonizedProcess model ) => int.Parse( await GetResponse( await _client.PostAsync( GetKeyQuery( "", key ), ToContent( model ) ).ConfigureAwait( false ) ).ConfigureAwait( false ) );
 public async Task Edit( IPasswordedDemonizedProcess model ) => await GetResponse( await _client.PostAsync( GetKeyQuery( "Edit", key ), ToContent( model ) ).ConfigureAwait( false ) ).ConfigureAwait( false );
 public async Task<int> Create( IPasswordedDemonizedProcess model ) => await _processRepository.Create(model).ConfigureAwait(false);