/// <summary> /// Copy values from a Dynamics legal entity to a view model. /// </summary> /// <param name="to"></param> /// <param name="from"></param> public static void CopyValues(this MS.FileServices.FileSystemItem to, ViewModels.FileSystemItem from) { to.Name = CombineNameDocumentType(from.name, from.documenttype); to.Size = from.size; to.TimeCreated = from.timecreated; to.TimeLastModified = from.timelastmodified; }
/// <summary> /// Convert a given voteQuestion to a ViewModel /// </summary> public static ViewModels.FileSystemItem ToViewModel(this MS.FileServices.FileSystemItem fileSystemItem) { ViewModels.FileSystemItem result = null; if (fileSystemItem != null) { result = new ViewModels.FileSystemItem(); if (fileSystemItem.Id != null) { result.id = fileSystemItem.Id; } result.name = GetDocumentName(fileSystemItem.Name); result.documenttype = GetDocumentType(fileSystemItem.Name); result.size = fileSystemItem.Size; result.timecreated = fileSystemItem.TimeCreated; result.timelastmodified = fileSystemItem.TimeLastModified; } return(result); }