Conformed the ModelContext from SwiftData to the Repository protocol in the app target.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import SwiftData
|
||||
|
||||
/// Extends ModelContext to conform to the Repository protocol.
|
||||
///
|
||||
/// This extension allows ModelContext from SwiftData to be used as a repository,
|
||||
/// enabling dependency injection and facilitating unit testing by allowing mock
|
||||
/// repositories to be substituted during tests.
|
||||
extension ModelContext: Repository {}
|
||||
Reference in New Issue
Block a user