public ChangesNotificationService(BlobShareDataStoreEntities context)
     : this(context,
         new BlobSetService(context),
         new SmtpNotificationService(
             ConfigReader.GetConfigValue("SmtpHost"),
             int.Parse(ConfigReader.GetConfigValue("SmtpPort"), CultureInfo.InvariantCulture),
             ConfigReader.GetConfigValue("SmtpUser"),
             ConfigReader.GetConfigValue("SmtpPassword"),
             ConfigReader.GetConfigValue("SmtpSenderName"),
             ConfigReader.GetConfigValue("SmtpSenderAddress")))
 {
 }
Ejemplo n.º 2
0
 private User GetTestUser(BlobShareDataStoreEntities context)
 {
     UserService userService = new UserService(context);
     User user = new User()
     {
         Name = "Test User",
         Email = "*****@*****.**",
         IdentityProvider = "identityProvider",
         NameIdentifier = "nameIdentifier"
     };
     userService.CreateUser(user);
     return user;
 }
        public static BlobShareDataStoreEntities CreateInstance()
        {
            var connectionString = GetSetting("BlobShareDataStoreEntities");
            if (string.IsNullOrWhiteSpace(connectionString))
            {
                throw new ConfigurationErrorsException("Missing BlobShareDataStoreEntities.");
            }

            var entityConnectionString = string.Format(CultureInfo.InvariantCulture, EntityConnectionStringTemplate, connectionString);
            var context = new BlobShareDataStoreEntities(new EntityConnection(entityConnectionString));

            return context;
        }
Ejemplo n.º 4
0
        public static BlobShareDataStoreEntities CreateInstance()
        {
            var connectionString = GetSetting("BlobShareDataStoreEntities");

            if (string.IsNullOrWhiteSpace(connectionString))
            {
                throw new ConfigurationErrorsException("Missing BlobShareDataStoreEntities.");
            }

            var entityConnectionString = string.Format(CultureInfo.InvariantCulture, EntityConnectionStringTemplate, connectionString);
            var context = new BlobShareDataStoreEntities(new EntityConnection(entityConnectionString));

            return(context);
        }
Ejemplo n.º 5
0
 public PermissionService(BlobShareDataStoreEntities context)
 {
     this.context = context;
 }
Ejemplo n.º 6
0
 public EventService(BlobShareDataStoreEntities context, IUserService userService)
 {
     this.context = context;
     this.userService = userService;
 }
Ejemplo n.º 7
0
 public EventService(BlobShareDataStoreEntities context)
     : this(context, new UserService(context))
 {
 }
Ejemplo n.º 8
0
 public UserService(BlobShareDataStoreEntities context, IEventService eventService)
 {
     this.context = context;
     this.eventService = eventService;
 }
Ejemplo n.º 9
0
        internal static User CreateUserForTest(string name, BlobShareDataStoreEntities context)
        {
            User user = new User()
            {
                UserId = Guid.NewGuid(),
                Name = name,
                Email = name,
                NameIdentifier = name,
                IdentityProvider = name,
            };

            context.Users.AddObject(user);
            context.SaveChanges();

            return user;
        }
Ejemplo n.º 10
0
        private BlobSet GetTestBlobSet(BlobShareDataStoreEntities context)
        {
            BlobSet set = new BlobSet()
            {
                BlobSetId = Guid.NewGuid(),
                Name = "Test Resource Set"
            };

            context.BlobSets.AddObject(set);

            return set;
        }
Ejemplo n.º 11
0
        private Blob GetTestBlob(BlobShareDataStoreEntities context)
        {
            Blob blob = new Blob()
            {
                BlobId = Guid.NewGuid(),
                Name = "Test Blob Resource",
                OriginalFileName = "originalfile.txt",
                UploadDateTime = DateTime.UtcNow
            };

            context.Blobs.AddObject(blob);

            return blob;
        }
Ejemplo n.º 12
0
        internal static Blob CreateBlobForTest(string name, BlobShareDataStoreEntities context)
        {
            BlobService service = new BlobService(context, CloudStorageAccount.DevelopmentStorageAccount, TestContainerName);
            Blob blob = new Blob()
            {
                Name = "Test Resource",
                OriginalFileName = "logo-dpe.png",
                Description = "Test Resource",
                UploadDateTime = DateTime.Now
            };

            Stream stream = new FileStream("logo-dpe.png", FileMode.Open, FileAccess.Read);

            service.UploadBlob(blob, stream);

            stream.Close();

            return blob;
        }
Ejemplo n.º 13
0
        private static BlobSet CreateBlobSetForTest(string name, BlobShareDataStoreEntities context)
        {
            var service = new BlobSetService(context);
            BlobSet entity = new BlobSet()
            {
                Name = name
            };

            service.CreateBlobSet(entity);

            return entity;
        }
Ejemplo n.º 14
0
 public InvitationService(BlobShareDataStoreEntities context, IPermissionService permissionService, INotificationService notificationService)
 {
     this.context = context;
     this.permissionService = permissionService;
     this.notificationService = notificationService;
 }
Ejemplo n.º 15
0
 public BlobService(BlobShareDataStoreEntities context, CloudStorageAccount storageAccount, string containerName)
 {
     this.context = context;
     this.storageAccount = storageAccount;
     this.containerName = containerName;
 }
Ejemplo n.º 16
0
        internal static Role CreateRoleForTest(string name, BlobShareDataStoreEntities context)
        {
            Role role = new Role()
            {
                RoleName = name,
                Description = name
            };

            context.Roles.AddObject(role);
            context.SaveChanges();

            return role;
        }
Ejemplo n.º 17
0
 public ChangesNotificationService(BlobShareDataStoreEntities context, BlobSetService blobSetService, SmtpNotificationService smtpNotificationService)
 {
     this.context = context;
     this.blobSetService = blobSetService;
     this.smtpNotificationService = smtpNotificationService;
 }
Ejemplo n.º 18
0
 public RoleService(BlobShareDataStoreEntities context)
 {
     this.context = context;
 }
Ejemplo n.º 19
0
 public UserService(BlobShareDataStoreEntities context)
 {
     this.context = context;
     this.eventService = new EventService(context, this);
 }