public virtual void Update(ApplicationPermission entity)
 {
     if (entity != null)
     {
         this.Context.Entry<ApplicationPermission>(entity).State = EntityState.Modified;
     }
 }
 public IdentityResult CreatePermission(ApplicationPermission per)
 {
     _permissionStore.Create(per);
     return IdentityResult.Success;
 }
 public async Task<IdentityResult> CreatePermissionAsync(ApplicationPermission per)
 {
     await _permissionStore.CreateAsync(per);
     return IdentityResult.Success;
 }
 public void Delete(ApplicationPermission entity)
 {
     this.DbEntitySet.Remove(entity);
 }
 public void Create(ApplicationPermission entity)
 {
     this.DbEntitySet.Add(entity);
 }
 public virtual void Update(ApplicationPermission per)
 {
     this.ThrowIfDisposed();
     if (per == null)
     {
         throw new ArgumentNullException("Permission");
     }
     this._permissionStore.Update(per);
     this.Context.SaveChanges();
 }
        //public Task<ApplicationPermission> FindByNameAsync(string groupName)
        //{
        //    this.ThrowIfDisposed();
        //    return QueryableExtensions
        //        .FirstOrDefaultAsync<ApplicationPermission>(this._groupStore.EntitySet, 
        //            (ApplicationPermission u) => u.Name.ToUpper() == groupName.ToUpper());
        //}


        public virtual async Task UpdateAsync(ApplicationPermission per)
        {
            this.ThrowIfDisposed();
            if (per == null)
            {
                throw new ArgumentNullException("Permission");
            }
            this._permissionStore.Update(per);
            await this.Context.SaveChangesAsync();
        }