Skip to content

Commit 42c58dc

Browse files
committed
beta.1
1 parent 89e0a80 commit 42c58dc

File tree

3 files changed

+48
-16
lines changed

3 files changed

+48
-16
lines changed

src/Calabonga.UnitOfWork/Calabonga.UnitOfWork.csproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5-
<Version>6.0.0</Version>
5+
<Version>6.1.0-beta.1</Version>
66
<Authors>Calabonga</Authors>
77
<Company>Calabonga SOFT</Company>
8-
<Copyright>Calabonga SOFT © 2001-$([System.DateTime]::Now.ToString(yyyy))</Copyright>
8+
<Copyright>Calabonga SOFT © 2001-$([System.DateTime]::Now.ToString(yyyy))</Copyright>
99
<Description>Unit of Work implementation for EntityFramework Core. For more information please see Calabonga.UnitOfWork package.</Description>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<PackageIcon>logo.png</PackageIcon>
@@ -17,10 +17,10 @@
1717
<PackageReadmeFile>README.md</PackageReadmeFile>
1818
<RepositoryUrl>https://github.com/Calabonga/UnitOfWork</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
20-
<IncludeSymbols>true</IncludeSymbols>
21-
<IncludeSource>true</IncludeSource>
22-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23-
<Deterministic>true</Deterministic>
20+
<IncludeSymbols>true</IncludeSymbols>
21+
<IncludeSource>true</IncludeSource>
22+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23+
<Deterministic>true</Deterministic>
2424
</PropertyGroup>
2525

2626
<ItemGroup>
@@ -33,15 +33,15 @@
3333
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" Condition="'$(TargetFramework)' == 'net9.0'" />
3434
</ItemGroup>
3535

36-
<ItemGroup>
37-
<None Include="..\..\README.md">
38-
<Pack>True</Pack>
39-
<PackagePath>\</PackagePath>
40-
</None>
41-
<None Include="logo.png">
42-
<Pack>True</Pack>
43-
<PackagePath>\</PackagePath>
44-
</None>
45-
</ItemGroup>
36+
<ItemGroup>
37+
<None Include="..\..\README.md">
38+
<Pack>True</Pack>
39+
<PackagePath>\</PackagePath>
40+
</None>
41+
<None Include="logo.png">
42+
<Pack>True</Pack>
43+
<PackagePath>\</PackagePath>
44+
</None>
45+
</ItemGroup>
4646

4747
</Project>

src/Calabonga.UnitOfWork/IUnitOfWork.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ public interface IUnitOfWork : IDisposable
7878
/// <returns>An <see cref="IQueryable{T}"/> that contains elements that satisfy the condition specified by raw SQL.</returns>
7979
IQueryable<TEntity> FromSqlRaw<TEntity>(string sql, params object[] parameters) where TEntity : class;
8080

81+
/// <summary>
82+
/// Uses interpolated raw SQL queries to fetch the specified <typeparamref name="TEntity"/> data.
83+
/// </summary>
84+
/// <typeparam name="TEntity"></typeparam>
85+
/// <param name="sql"></param>
86+
/// <returns></returns>
87+
IQueryable<TEntity> FromSqlRawInterpolated<TEntity>(FormattableString sql) where TEntity : class;
88+
89+
/// <summary>
90+
/// Uses SQL queries to fetch the specified <typeparamref name="TEntity"/> data.
91+
/// </summary>
92+
/// <typeparam name="TEntity"></typeparam>
93+
/// <param name="sql"></param>
94+
/// <returns></returns>
95+
IQueryable<TEntity> FromSql<TEntity>(FormattableString sql) where TEntity : class;
96+
8197
/// <summary>
8298
/// Uses Track Graph Api to attach disconnected entities
8399
/// </summary>

src/Calabonga.UnitOfWork/UnitOfWork.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,22 @@ public IRepository<TEntity> GetRepository<TEntity>(bool hasCustomRepository = fa
141141
/// <returns>An <see cref="IQueryable{T}" /> that contains elements that satisfy the condition specified by raw SQL.</returns>
142142
public IQueryable<TEntity> FromSqlRaw<TEntity>(string sql, params object[] parameters) where TEntity : class => DbContext.Set<TEntity>().FromSqlRaw(sql, parameters);
143143

144+
/// <summary>
145+
/// Uses interpolated raw SQL queries to fetch the specified <typeparamref name="TEntity"/> data.
146+
/// </summary>
147+
/// <typeparam name="TEntity"></typeparam>
148+
/// <param name="sql"></param>
149+
/// <returns></returns>
150+
public IQueryable<TEntity> FromSqlRawInterpolated<TEntity>(FormattableString sql) where TEntity : class => DbContext.Set<TEntity>().FromSqlInterpolated(sql);
151+
152+
/// <summary>
153+
/// Uses SQL queries to fetch the specified <typeparamref name="TEntity"/> data.
154+
/// </summary>
155+
/// <typeparam name="TEntity"></typeparam>
156+
/// <param name="sql"></param>
157+
/// <returns></returns>
158+
public IQueryable<TEntity> FromSql<TEntity>(FormattableString sql) where TEntity : class => DbContext.Set<TEntity>().FromSql(sql);
159+
144160
/// <summary>
145161
/// Saves all changes made in this context to the database.
146162
/// </summary>

0 commit comments

Comments
 (0)