Пример #1
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            DataServiceContext context =
                new DataServiceContext(CloudStorageAccount.DevelopmentStorageAccount.TableEndpoint.AbsoluteUri,
                    CloudStorageAccount.DevelopmentStorageAccount.Credentials);

            CloudBlobClient blobClient = new CloudBlobClient(CloudStorageAccount.DevelopmentStorageAccount.BlobEndpoint.AbsoluteUri,
                CloudStorageAccount.DevelopmentStorageAccount.Credentials);

            Services = new ServiceFacade();

            Services.Accounts = new AccountService(Services, new AccountServiceImplementor(context));
            Services.Groups = new GroupService(Services, new GroupServiceImplementor(context));
            Services.Roles = new RoleService(Services, new RoleServiceImplementor(context));
            Services.Images = new ImageService(Services, new ImageServiceImplementor(context));
            Services.Blobs = new BlobService(Services, new BlobServiceImplementor(blobClient));

            if (User.Identity.IsAuthenticated)
                Account = Services.Accounts.Get(User.Identity.Name);
            else
                Account = null;

            if (null == Account)
                FormsAuthentication.SignOut();
            else
            {
                Account.LastActivityDate = DateTime.Now;
                Account.Save();
            }

            ViewData["Account"] = Account;
        }
Пример #2
0
 /// <summary>
 /// Создает новый сервис изображений на основе имплементора.
 /// </summary>
 /// <param name="implementor"> Имплементор </param>
 /// <param name="services"> Сервисы </param>
 public ImageService(ServiceFacade services, IImageServiceImplementor implementor)
 {
     _services = services;
     _implementor = implementor;
 }
Пример #3
0
 /// <summary>
 /// Создает сервис учетных записей на основе имплементора.
 /// </summary>
 /// <param name="implementor"> Имплементор </param>
 /// <param name="services"> Сервисы </param>
 public AccountService(ServiceFacade services, IAccountServiceImplementor implementor)
 {
     _services = services;
     _implementor = implementor;
 }
Пример #4
0
 public BlobService(ServiceFacade services, IBlobServiceImplementor implementor)
 {
     _services = services;
     _implementor = implementor;
 }
Пример #5
0
 /// <summary>
 /// Создает новый сервис групп на основе имплементора.
 /// </summary>
 /// <param name="implementor"> Имплементор </param>
 /// <param name="services"> Сервисы </param>
 public GroupService(ServiceFacade services, IGroupServiceImplementor implementor)
 {
     _services = services;
     _implementor = implementor;
 }
Пример #6
0
 /// <summary>
 /// Создает новую модель роли на основе имплементора. 
 /// </summary>
 /// <param name="implementor"></param>
 /// <param name="services"> Сервисы </param>
 public Role(ServiceFacade services, IRoleImplementor implementor)
 {
     _services = services;
     _implementor = implementor;
 }