|
|
|
@ -165,7 +165,7 @@ public class BookRepository : EfCoreRepository<BookStoreDbContext, Book, Guid>, |
|
|
|
|
|
|
|
public async Task DeleteBooksByType(BookType type) |
|
|
|
{ |
|
|
|
await DbContext.Database.ExecuteSqlCommandAsync( |
|
|
|
await DbContext.Database.ExecuteSqlRawAsync( |
|
|
|
$"DELETE FROM Books WHERE Type = {(int)type}" |
|
|
|
); |
|
|
|
} |
|
|
|
@ -317,4 +317,4 @@ context.Services.AddAbpDbContext<OtherDbContext>(options => |
|
|
|
}); |
|
|
|
```` |
|
|
|
|
|
|
|
在这个例子中,`OtherDbContext`实现了`IBookStoreDbContext`. 此功能允许你在开发时使用多个DbContext(每个模块一个),但在运行时可以使用单个DbContext(实现所有DbContext的所有接口). |
|
|
|
在这个例子中,`OtherDbContext`实现了`IBookStoreDbContext`. 此功能允许你在开发时使用多个DbContext(每个模块一个),但在运行时可以使用单个DbContext(实现所有DbContext的所有接口). |
|
|
|
|