TemplateProxyExample.Models.User.UserConfig.Save C# (CSharp) Method

Save() public method

public Save ( ) : void
return void
        public void Save()
        {
            string path = string.Concat(Helpers.ServiceHelper.UserStoreLocation, "\\", this.AuthorizationToken, ".json");
            var output = Newtonsoft.Json.JsonConvert.SerializeObject(this);

            File.WriteAllText(path, output);
        }
    }

Usage Example

 public static UserConfig CreateNew(string email, Guid linnworksUniqueIdentifier, string accountName)
 {
     UserConfig result = new UserConfig();
     result.AuthorizationToken = Guid.NewGuid().ToString("N");
     result.Email = email;
     result.LinnworksUniqueIdentifier = linnworksUniqueIdentifier;
     result.AccountName = accountName;
     result.Save();
     return result;
 }
All Usage Examples Of TemplateProxyExample.Models.User.UserConfig::Save