Add Queryable.OfType

This commit is contained in:
sunkaixuan
2025-01-20 15:13:02 +08:00
parent 49e8af7e65
commit 0c86779506
2 changed files with 5 additions and 0 deletions

View File

@@ -359,6 +359,10 @@ namespace SqlSugar
this.QueryBuilder.IsCrossQueryWithAttr = true;
return this.AS(asName);
}
public ISugarQueryable<Type> OfType<Type>()
{
return this.Select<Type>().Select("*");
}
public ISugarQueryable<T> AsType(Type tableNameType)
{
if (tableNameType == null)

View File

@@ -22,6 +22,7 @@ namespace SqlSugar
ISugarQueryable<T> AS(string tableName);
ISugarQueryable<T> AsWithAttr();
ISugarQueryable<T> AsType(Type tableNameType);
ISugarQueryable<Type> OfType<Type>();
ISugarQueryable<T> With(string withString);
//ISugarQueryable<T> CrossQueryWithAttr();
ISugarQueryable<T> CrossQuery<Type>(string configId);