public async Task <int> DeletePropertyDocumentAsync(PropertyCheckListDocumentsModel documents) { using (var dataService = DataServiceFactory.CreateDataService()) { var doc = new PropertyCheckListDocuments(); UpdateDocumentFromModel(doc, documents); return(await dataService.DeletePropertyCheckListDocumentAsync(doc)); } }
private void UpdateDocumentFromModel(PropertyCheckListDocuments target, PropertyCheckListDocumentsModel source) { target.PropertyCheckListBlobId = source.PropertyCheckListBlobId; target.CheckListPropertyId = source.CheckListPropertyId; target.PropertyGuid = source.guid; target.FileBlob = source.ImageBytes; target.FileName = source.FileName; target.FileType = source.ContentType; target.FileCategoryId = source.FileCategoryId; target.UploadTime = DateTime.Now; target.DueDate = source.DueDate.UtcDateTime; target.ActualCompletionDate = source.ActualCompletionDate.UtcDateTime; target.Remarks = source.Remarks; }