示例#1
0
        public async Task AddAsync(IFeatureInfo info)
        {
            var context = _contextStorage.Get();

            context.Features.Add(new FeatureEntity(info));
            await context.SaveChangesAsync();
        }
        public async Task AddAsync(int userId, IProjectInfo info)
        {
            var context = _contextStorage.Get();

            context.Projects.Add(new ProjectEntity(userId, info));
            await context.SaveChangesAsync();
        }
示例#3
0
        public async Task AddAsync(ITaskInfo task)
        {
            var context = _contextStorage.Get();

            context.Tasks.Add(new TaskEntity(task));
            await context.SaveChangesAsync();
        }
        private SessionsContainer GetSessionsContainer()
        {
            IContextStorage <SessionsContainer> storage = this.GetContextStorage();
            SessionsContainer container = storage.Get();

            if (container == null)
            {
                container = new SessionsContainer();
                storage.Store(container);
            }

            return(container);
        }
示例#5
0
        public Task AddAsync(IUserInfo user)
        {
            var context = _contextStorage.Get();

            context.Users.Add(new UserEntity(user));

            return(context.SaveChangesAsync());
        }
 protected override Task SaveChangesAsync()
 {
     return(_contextStorage.Get().SaveChangesAsync());
 }