/// <summary> /// Create Newsletters from a (json) file /// </summary> /// <param name="context"></param> /// <param name="NewsletterJsonPath"></param> public static void AddInitialNewslettersFromFile(this IDynamicsClient context, string NewsletterJsonPath) { if (!string.IsNullOrEmpty(NewsletterJsonPath) && File.Exists(NewsletterJsonPath)) { string NewsletterJson = File.ReadAllText(NewsletterJsonPath); context.AddInitialNewsletters(NewsletterJson); } }
private static void AddInitialNewsletters(this IDynamicsClient context, string NewsletterJson) { List <ViewModels.Newsletter> Newsletters = JsonConvert.DeserializeObject <List <ViewModels.Newsletter> >(NewsletterJson); if (Newsletters != null) { context.AddInitialNewsletters(Newsletters); } }