コード例 #1
0
        public async Task <TO> FindSelectAsync <TO>(TO entity) where TO : EntidadeBase
        {
            {
                var sql = RepositoryUtil.GetKeyFilterSql(entity, out bool nonKeys);
                if (nonKeys == false)
                {
                    var valueFound = await FindSingleOrDefaultSqlAsync <TO>(sql);

                    if (valueFound != null)
                    {
                        return(valueFound);
                    }
                }
            }

            {
                var sql = RepositoryUtil.GetDnUniqueKeyFilterSql(entity, out bool nonKeys);
                if (nonKeys == false)
                {
                    var valueFound = await FindSingleOrDefaultSqlAsync <TO>(sql);

                    if (valueFound != null)
                    {
                        return(valueFound);
                    }
                }
            }

            return(null);
        }
コード例 #2
0
        public virtual async Task <int> QuantidadeAsync(TE entity, bool includeExcludedLogically = false)
        {
            var sql = RepositoryUtil.GetKeyAndDnUniqueKeyFilterSql(entity);

            return(await CountSqlAsync(sql, includeExcludedLogically));
        }
コード例 #3
0
 internal async Task <List <object> > ExistOnListAsync(PropertyInfo property, Type dbEntityType, object[] elements)
 {
     var outType = property.PropertyType;
     var sql     = RepositoryUtil.ListToInSql(dbEntityType, elements, property);