예제 #1
0
        public bool DeleteCompany(Guid IdCompany)
        {
            Company companyCurrent = db.Companies.FirstOrDefault(x => x.ID == IdCompany);

            if (companyCurrent != null)
            {
                db.Companies.Remove(companyCurrent);
                db.Entry(companyCurrent).State = EntityState.Deleted;
                db.SaveChanges();
                return(true);
            }
            return(false);
        }
예제 #2
0
        public bool DeleteEndUser(Guid ID)
        {
            EndUser enduserCurrent = db.EndUsers.FirstOrDefault(x => x.ID == ID);

            if (enduserCurrent != null)
            {
                db.EndUsers.Remove(enduserCurrent);
                db.Entry(enduserCurrent).State = EntityState.Deleted;
                db.SaveChanges();
                return(true);
            }
            return(false);
        }