Example #1
0
 public async Task <IPagedResult <IFeatureModel> > Get([FromQuery] FeaturesFilter filter)
 {
     using (_context.Scope())
     {
         return(await _featuresDataProvider.Get(HttpContext.User.GetUserId()).GetPagedResultAsync(filter));
     }
 }
 public async Task <Permission[]> Get(int userId, int projectId)
 {
     using (_context.Scope())
     {
         return(await _permissionsDataProvider.Get(userId, projectId).ToArrayAsync());
     }
 }
Example #3
0
 public async Task <IPagedResult <IProject> > Get([FromQuery] ProjectsFilter filter)
 {
     using (_context.Scope())
     {
         return(await _projectsDataProvider.Get(HttpContext.User.GetUserId()).GetPagedResultAsync(filter));
     }
 }
Example #4
0
 public async Task Add([FromBody] UserInfoModel userModel)
 {
     using (_context.Scope())
     {
         await _usersDataProvider.AddAsync(userModel);
     }
 }
Example #5
0
        public override async Task OnConnectedAsync()
        {
            using (_connectionContext.Scope())
            {
                await _usersDataProvider.Add(Context.User.GetUserId(), Context.ConnectionId);
            }

            await base.OnConnectedAsync();
        }
Example #6
0
 public async Task <object> Authenticate([FromBody] LoginModel model)
 {
     using (_context.Scope())
     {
         return(new
         {
             Token = await _loginDataProvider.AuthenticateAsync(model.Username, model.Password)
         });
     }
 }
Example #7
0
 public async Task <IPagedResult <ITask> > Get([FromQuery] TaskFilter filter)
 {
     using (_context.Scope())
     {
         return(await _taskDataProvider.GetLiveTasks(HttpContext.User.GetUserId(), filter.ProjectId).GetPagedResultAsync(filter));
     }
 }
        private void ExecuteScope(ScopeType type, bool isInTransactionScope)
        {
            if (type == ScopeType.Event)
            {
                _connectionContext.EventScope();
                return;
            }

            if (isInTransactionScope)
            {
                _connectionContext.TransactionScope();
            }
            else
            {
                _connectionContext.Scope();
            }
        }