示例#1
0
 public void Delete(Securables entity)
 {
     try
     {
         entities.Securabless.Remove(entity);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
 public void Add(Securables entity)
 {
     try
     {
         entities.Securabless.Add(entity);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
 public void Attach(Securables entity)
 {
     try
     {
         entities.Securabless.Attach(entity);
         entities.Entry(entity).State = EntityState.Modified;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
        public void Save(Securables entity)
        {
            try
            {
                Securables securables = entities.Securabless
                                        .Where(x => x.SecurableID == entity.SecurableID).FirstOrDefault();

                if (securables != null)
                {
                    entities.Entry(securables).State = EntityState.Modified;
                }
                else
                {
                    Add(entity);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
 public bool IsSecuredAllowed(string securable)
 {
     return(Securables.ContainsKey(securable) && Securables[securable]);
 }