public async IAsyncEnumerable <TReturn> FindAsync <TData, TReturn>(Action <TData> model) where TReturn : new() { ToSql.SqlBuilder SqlBuilder = ToSql.Select.FromProperties <TData>(); await foreach (TReturn item in Session.QueryAsync <TReturn>(SqlBuilder.ToString())) { yield return(item); } }
public async Task <TReturn> GetAsync <TData, TReturn>(TData model) where TReturn : new() { ToSql.SqlBuilder SqlBuilder = ToSql.Select.FromProperties <TData>(); return(await Session.QueryFirstAsync <TReturn>(SqlBuilder.ToString())); }
public async Task <TData> GetAsync <TData, TId>(TId id) where TData : class, new() where TId : struct { ToSql.SqlBuilder SqlBuilder = ToSql.Select.FromProperties <TData>(); return(await Session.QueryFirstAsync <TData>(SqlBuilder.ToString())); }