title: Initializing object data in the constructor by deserializing a json file
body: <p>Ok so I want to get rid of the first constructor, and be able to deserialize directly. Is there a way to just pull each variable from the json one at a time? Or is there a blanket statement I could use to pull them all at once and populate the object.</p>
  
  <pre><code> public MasterEmailSettings()
   {
        _user = "";
        _password = "";
        _domain = "";
        _emailAddress = "";
   }
   public MasterEmailSettings(string path)
   {
        var tempObject = new MasterEmailSettings();
  
        try
        {
             tempObject = JsonConvert.DeserializeObject&lt;MasterEmailSettings&gt;(File.ReadAllText(path));
             _domain = tempObject.Domain;
             _password = tempObject.Password;
             _user = tempObject.User;
             _emailAddress = tempObject.EmailAddress;
        }
        catch (Exception ex)
        {
             Console.WriteLine(ex.ToString());
        }
   }
  </code></pre>