- 调整 命名空间,归纳 FreeSql.Interface;

This commit is contained in:
28810
2019-05-07 20:20:38 +08:00
parent 59b1b7220d
commit 22a6c3d93e
71 changed files with 1033 additions and 1037 deletions

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
namespace FreeSql.Interface {
public interface ILinqToSql<T1> where T1 : class {
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TReturn> Select<TReturn>(Expression<Func<T1, TReturn>> select) where TReturn : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> Join<TInner, TKey, TResult>(ISelect<TInner> inner, Expression<Func<T1, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<T1, TInner, TResult>> resultSelector) where TInner : class where TResult : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> GroupJoin<TInner, TKey, TResult>(ISelect<TInner> inner, Expression<Func<T1, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<T1, ISelect<TInner>, TResult>> resultSelector) where TInner : class where TResult : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<T1> DefaultIfEmpty();
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> SelectMany<TCollection, TResult>(Expression<Func<T1, ISelect<TCollection>>> collectionSelector, Expression<Func<T1, TCollection, TResult>> resultSelector) where TCollection : class where TResult : class;
}
}

View File

@ -6,7 +6,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect0<TSelect, T1> {
/// <summary>

View File

@ -1,11 +1,12 @@
using System;
using FreeSql.Interface;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
public interface ISelect<T1> : ISelect0<ISelect<T1>, T1> where T1 : class {
public interface ISelect<T1> : ISelect0<ISelect<T1>, T1>, Interface.ILinqToSql<T1> where T1 : class {
/// <summary>
/// 执行SQL查询是否有记录
@ -31,27 +32,6 @@ namespace FreeSql {
List<TReturn> ToList<TReturn>(Expression<Func<T1, TReturn>> select);
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<T1, TReturn>> select);
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TReturn> Select<TReturn>(Expression<Func<T1, TReturn>> select) where TReturn : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> Join<TInner, TKey, TResult>(ISelect<TInner> inner, Expression<Func<T1, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<T1, TInner, TResult>> resultSelector) where TInner : class where TResult : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> GroupJoin<TInner, TKey, TResult>(ISelect<TInner> inner, Expression<Func<T1, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<T1, ISelect<TInner>, TResult>> resultSelector) where TInner : class where TResult : class;
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<T1> DefaultIfEmpty();
/// <summary>
/// 【linq to sql】专用方法不建议直接使用
/// </summary>
ISelect<TResult> SelectMany<TCollection, TResult>(Expression<Func<T1, ISelect<TCollection>>> collectionSelector, Expression<Func<T1, TCollection, TResult>> resultSelector) where TCollection : class where TResult : class;
/// <summary>
/// 执行SQL查询返回指定字段的记录的第一条记录记录不存在时返回 TReturn 默认值
/// </summary>

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2> : ISelect0<ISelect<T1, T2>, T1> where T1 : class where T2 : class {
bool Any(Expression<Func<T1, T2, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3> : ISelect0<ISelect<T1, T2, T3>, T1> where T1 : class where T2 : class where T3 : class {
bool Any(Expression<Func<T1, T2, T3, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4> : ISelect0<ISelect<T1, T2, T3, T4>, T1> where T1 : class where T2 : class where T3 : class where T4 : class {
bool Any(Expression<Func<T1, T2, T3, T4, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5> : ISelect0<ISelect<T1, T2, T3, T4, T5>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5, T6> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5, T6, T7> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class {
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp);

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq.Expressions;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelectFromExpression<T1> where T1 : class {
ISelectFromExpression<T1> LeftJoin(Expression<Func<T1, bool>> exp);

View File

@ -4,7 +4,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ISelectGrouping<TKey, TValue> {
/// <summary>
/// 按聚合条件过滤Where(a => a.Count() > 10)

View File

@ -7,7 +7,7 @@ using System.Data.Common;
using System.Text;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public partial interface IAdo {
/// <summary>
/// 主库连接池

View File

@ -7,7 +7,7 @@ using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;
namespace FreeSql {
namespace FreeSql.Interface {
public interface IAop {
/// <summary>

View File

@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ICache {
/// <summary>

View File

@ -2,7 +2,7 @@
using FreeSql.Internal.Model;
using System;
namespace FreeSql {
namespace FreeSql.Interface {
public interface ICodeFirst {
/// <summary>

View File

@ -1,57 +0,0 @@
//using FreeSql.DatabaseModel;
//using System;
//using System.Collections.Generic;
//using System.Text;
//namespace FreeSql {
// public interface IDbManage {
// /// <summary>
// /// 判断表是否存在
// /// </summary>
// /// <param name="name">表名</param>
// /// <returns></returns>
// bool ExistsTable(string name);
// /// <summary>
// /// 判断列是否存在
// /// </summary>
// /// <param name="table">表名</param>
// /// <param name="column">列名</param>
// /// <returns></returns>
// bool ExistsColumn(string table, string column);
// /// <summary>
// /// 判断视图是否存在
// /// </summary>
// /// <param name="name">视图名</param>
// /// <returns></returns>
// bool ExistsView(string name);
// /// <summary>
// /// 判断列是否存在
// /// </summary>
// /// <param name="view">视图名</param>
// /// <param name="column">列名</param>
// /// <returns></returns>
// bool ExistsColumnByView(string view, string column);
// /// <summary>
// /// 获取表信息,包括表、列详情、主键、唯一键、索引、备注(注意:本方法不返回外键)
// /// </summary>
// /// <param name="name">表名</param>
// /// <returns></returns>
// DbTableInfo GetTableInfo(string name);
// /// <summary>
// /// 获取视图信息,包括表、列详情
// /// </summary>
// /// <param name="name">视图名</param>
// /// <returns></returns>
// DbTableInfo GetViewInfo(string name);
// /// <summary>
// /// 获取指定数据库的表信息,包括表、列详情、主键、唯一键、索引、外键、备注
// /// </summary>
// /// <param name="database"></param>
// /// <returns></returns>
// List<DbTableInfo> GetTablesByDatabase(params string[] database);
// }
//}

View File

@ -1,4 +1,5 @@
using FreeSql;
using FreeSql.Interface;
using System;
using System.Collections.Generic;

View File

@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
namespace FreeSql {
namespace FreeSql.Interface {
public interface IDbFirst {
/// <summary>