示例#1
0
        public static RecordingService CreateRecordingService(string backupPath, MBFileService mbfileService = null)
        {
            var contextFactory      = new VoiceNotesContextFactory(backupPath);
            var voiceNoteContext    = contextFactory.CreateDbContext();
            var recordingRepository = new RecordingRepository(voiceNoteContext);

            return(new RecordingService(recordingRepository, mbfileService));
        }
示例#2
0
        public static MBFileService CreateMBFileService(Backup backup)
        {
            //todo: handle exception if cannot create repository!
            IMBFileRepository <IMBFile> mbfileRepository = MBFileRepositoryFactory.CreateMBFileRepository(backup);

            MBFileService mbfileService = new MBFileService(mbfileRepository);

            return(mbfileService);
        }
示例#3
0
 public RecordingService(IRecordingRepository recordingRepository, MBFileService mbfileService = null)
 {
     RecordingRepository = recordingRepository;
     MBFileService       = mbfileService;
 }
示例#4
0
 public AssetService(IAssetRepository assetRepository, MBFileService mbfileService = null)
 {
     AssetRepository = assetRepository;
     MBFileService   = mbfileService;
 }
示例#5
0
        public static AssetService CreateAssetService(string backupPath, Version productVersion, MBFileService mbfileService = null)
        {
            var contextFactory  = new PhotosContextFactory(backupPath, productVersion);
            var photosContext   = contextFactory.CreateDbContext();
            var assetRepository = new AssetRepository(photosContext);

            return(new AssetService(assetRepository, mbfileService));
        }