예제 #1
0
        /// <summary>
        /// Method to select a <see cref="VersionEntity"/> or default entity.
        /// </summary>
        /// <param name="op">Version select options to perform query.</param>
        /// <returns>A <see cref="VersionEntity"/> or default if not found.</returns>
        public VersionEntity SingleOrDefault(VersionOptionsSelect op)
        {
            if (op == null)
            {
                ArgumentNullException e = new ArgumentNullException(nameof(op));
                log.Error(e.Output(), e);
                throw e;
            }

            using (Db.Context) { return(VersionManager.Select(op)); }
        }
예제 #2
0
 /// <summary>
 /// Method to select a <see cref="VersionEntity"/> or default entity asynchronously.
 /// </summary>
 /// <param name="op">Version select options to perform query.</param>
 /// <returns>A <see cref="VersionEntity"/> or default if not found.</returns>
 public Task <VersionEntity> SingleOrDefaultAsync(VersionOptionsSelect op)
 => Task.Run(() => SingleOrDefault(op));
예제 #3
0
 /// <summary>
 /// Method to select a <see cref="VersionEntity"/> or null asynchronously.
 /// </summary>
 /// <param name="op">Version select options to perform query.</param>
 /// <returns>A <see cref="VersionEntity"/> or null if not found.</returns>
 public Task <VersionEntity> SingleOrNullAsync(VersionOptionsSelect op)
 => Task.Run(() => SingleOrNull(op));