コード例 #1
0
 /// <summary>
 /// Add ImportQueueRecordFile to database
 /// </summary>
 /// <param name="instance">ImportQueueRecordFile instance</param>
 /// <param name="saveAfterInsert">Save database after insertion</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void ImportQueueRecordFileInfoFileAdd(ImportQueueRecordFileInfoFile instance, bool saveAfterInsert = true, bool waitUntilSaving = true)
 {
     ImportQueueRecordFileInfoFileAdd(new ImportQueueRecordFileInfoFile[] { instance }, saveAfterInsert, waitUntilSaving);
 }
コード例 #2
0
 /// <summary>
 /// Remove ImportQueueRecordFile from database
 /// </summary>
 /// <param name="instance">ImportQueueRecordFile instance</param>
 /// <param name="saveAfterRemove">Save database after removing</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void ImportQueueRecordFileInfoFileRemove(ImportQueueRecordFileInfoFile instance, bool saveAfterRemove = true, bool waitUntilSaving = true)
 {
     ImportQueueRecordFileInfoFileRemove(new ImportQueueRecordFileInfoFile[] { instance }, saveAfterRemove, waitUntilSaving);
 }
コード例 #3
0
        /// <summary>
        /// Create/Get new ImportQueueRecordFile instance without any link to database
        /// </summary>
        /// <returns>ImportQueueRecordFile instance</returns>
        public ImportQueueRecordFileInfoFile ImportQueueRecordFileInfoFileNew(ImportQueueRecordFileInfoFileType fileType, ImportQueueRecordFileInfo importQueueRecordFileInfo = null, File file = null)
        {
            try
            {
                var dt = DateTime.UtcNow;
                var res = new ImportQueueRecordFileInfoFile()
                { 
                    Type = fileType,
                    ImportQueueRecordFileInfo = importQueueRecordFileInfo,
                    File = file
                };

                if (importQueueRecordFileInfo != null)
                    importQueueRecordFileInfo.Files.Add(res);
                return res;
            }
            catch(Exception ex)
            {
                Helpers.Log.Add(ex, string.Format("Repository.ImportQueueRecordFileInfoFileNew()"));
                throw;
            }
        }