Document Library fluent API 4.4 issue
I have this method working fine in version 4.1 SP3,
but will throw the exception below when in version 4.4
public static string GetDocumentUrl(string library, string docName) string r = string.Empty; var lib = App.WorkWith().DocumentLibraries().Where(l => l.Title == library).Get().FirstOrDefault(); if (lib != null) var doc = lib.Documents.Where(d => d.Title == docName).FirstOrDefault(); if (doc != null) r = doc.MediaUrl; return r;
I have taken your code and modified it a bit, since it was returning an object reference error. Please check the following code sample as well as the changes I have made to your code:
Thanks Victor, using the LibrariesManager did the trick.