title: How do I use WcfCoreMtomEncoder in a .Net Core project?
body: <p>I want to use this WcfCoreMtomEncoder lib <a href="https://github.com/lennykean/WcfCoreMtomEncoder" rel="noreferrer">here</a> in my .Net Core project but I'm not sure how to use it syntactically. </p>
  
  <p>I have this code below but can't use MessageEncoding because I'm in a .Net Core project (no mtom support):</p>
  
  <pre><code>var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport)
  { 
      // MessageEncoding = WSMessageEncoding.Mtom, not supported in .Net Core
      TransferMode = TransferMode.Streamed
  };
  
  EndpointAddress endpoint = new EndpointAddress(url);
  var channelFactory = new ChannelFactory&lt;T&gt;(binding, endpoint);
  var webService = channelFactory.CreateChannel();
  user.UserName = await webService.EncryptValueAsync(userName);
  user.Password = await webService.EncryptValueAsync(password);
  var documentAddResult = webService.DocumentAdd(document);
  channelFactory.Close();
  </code></pre>
  
  <p>From what I read I can replace it with this <a href="https://github.com/lennykean/WcfCoreMtomEncoder" rel="noreferrer">library</a> code below and I see from the documentation for the encoder lib that the usage looks like this:</p>
  
  <pre><code>var encoding = new MtomMessageEncoderBindingElement(new TextMessageEncodingBindingElement());
  var transport = new HttpTransportBindingElement();
  var customBinding = new CustomBinding(encoding, transport);
  
  var client = new MtomEnabledServiceClient(customBinding);
  </code></pre>
  
  <p>but I'm not sure what's what here?
  How would it be used to perform the document upload I'm trying to achieve? And is the library doing this or am I misunderstanding what it does?</p>
  
  <p>If anyone can provide me an example of how to use this library to perform the document upload it would be appreciated.</p>