コード例 #1
0
        public Database()
        {
            realmConfiguration = createRealmConfiguration();

            IdProvider      = new IdProvider(getRealmInstance);
            SinceParameters = new SinceParameterStorage(getRealmInstance);
            Tags            = Repository <IDatabaseTag> .For(getRealmInstance, (tag, realm) => new RealmTag(tag, realm));

            Tasks = Repository <IDatabaseTask> .For(getRealmInstance, (task, realm) => new RealmTask(task, realm));

            User = SingleObjectStorage <IDatabaseUser> .For(getRealmInstance, (user, realm) => new RealmUser(user, realm));

            Clients = Repository <IDatabaseClient> .For(getRealmInstance, (client, realm) => new RealmClient(client, realm));

            Projects = Repository <IDatabaseProject> .For(getRealmInstance, (project, realm) => new RealmProject(project, realm));

            TimeEntries = Repository <IDatabaseTimeEntry> .For(getRealmInstance, (timeEntry, realm) => new RealmTimeEntry(timeEntry, realm));

            Workspaces = Repository <IDatabaseWorkspace> .For(getRealmInstance, (workspace, realm) => new RealmWorkspace(workspace, realm));

            WorkspaceFeatures = Repository <IDatabaseWorkspaceFeatureCollection> .For(
                getRealmInstance,
                (collection, realm) => new RealmWorkspaceFeatureCollection(collection, realm),
                id => x => x.WorkspaceId == id,
                features => features.WorkspaceId);
        }
コード例 #2
0
        public Database()
        {
            IdProvider = new IdProvider();
            Tags       = Repository <IDatabaseTag> .For((tag, realm) => tag as RealmTag ?? new RealmTag(tag, realm));

            Tasks = Repository <IDatabaseTask> .For((task, realm) => task as RealmTask ?? new RealmTask(task, realm));

            User = SingleObjectStorage <IDatabaseUser> .For((user, realm) => user as RealmUser ?? new RealmUser(user, realm));

            Clients = Repository <IDatabaseClient> .For((client, realm) => client as RealmClient ?? new RealmClient(client, realm));

            Projects = Repository <IDatabaseProject> .For((project, realm) => project as RealmProject ?? new RealmProject(project, realm));

            TimeEntries = Repository <IDatabaseTimeEntry> .For((timeEntry, realm) => timeEntry as RealmTimeEntry ?? new RealmTimeEntry(timeEntry, realm));

            Workspaces = Repository <IDatabaseWorkspace> .For((workspace, realm) => workspace as RealmWorkspace ?? new RealmWorkspace(workspace, realm));
        }