DHBW-Service-App/DHBW-Service/CoreData/Models/User+CoreDataClass.swift
Patrick Müller f50ba8f19d :saprkles: Adding CoreData Helper Classes
- Also adding lecturer entity and relationship between event and lecturers.
- Preparation for CoreData refactoring
2021-02-10 19:17:11 +01:00

26 lines
549 B
Swift

//
// User+CoreDataClass.swift
// DHBW-Service
//
// Created by Patrick Müller on 10.02.21.
//
//
import Foundation
import CoreData
@objc(User)
public class User: NSManagedObject {
@nonobjc public class func getAll() -> [User] {
let managedContext =
PersistenceController.shared.context
do {
return try managedContext.fetch(User.fetchRequest())
} catch let error as NSError {
print("Could not fetch. \(error), \(error.userInfo)")
return []
}
}
}