Files
Library/OwnChar/Data/IDataProvider.cs

36 lines
1.3 KiB
C#

using OwnChar.Model;
namespace OwnChar.Data;
public interface IDataProvider
{
// General
abstract bool IsInitialized();
abstract void SetInitialized();
// Model
abstract T? Create<T>() where T : class, IOwnCharObject;
abstract bool Save<T>(T obj) where T : class, IOwnCharObject;
abstract bool Delete<T>(T obj) where T : class, IOwnCharObject;
// Hierarchy
abstract bool SetParent(UserProfile profile, UserAccount parent);
abstract bool SetParent(Character character, Group parent);
abstract bool SetParent(Property property, Character character);
abstract bool SetOwner(Group group, UserProfile owner);
abstract bool SetOwner(Character group, UserProfile owner);
// Gets
abstract UserAccount? GetUserAccount(string username, string password);
abstract UserProfile? GetUserProfile(string username);
abstract IEnumerable<UserProfile>? GetMembers(Group group);
abstract UserProfile? GetOwner(Group group);
abstract UserProfile? GetOwner(Character character);
abstract IEnumerable<Character>? GetCharacters(Group group);
abstract IEnumerable<Character>? GetCharacters(UserProfile jprofile);
// Sets
abstract bool AddMember(Group group, UserProfile user);
abstract bool RemoveMember(Group group, UserProfile user);
}