Ejemplo n.º 1
0
        public bool CreateUserRole(UserRole instance)
        {
            if (instance.Id == 0)
            {
                Db.UserRoles.InsertOnSubmit(instance);
                Db.UserRoles.Context.SubmitChanges();
                return true;
            }

            return false;
        }
Ejemplo n.º 2
0
        public bool UpdateUserRole(UserRole instance)
        {
            UserRole cache = Db.UserRoles.Where(p => p.Id == instance.Id).FirstOrDefault();
            if (cache != null)
            {
                //TODO : Update fields for UserRole
                Db.UserRoles.Context.SubmitChanges();
                return true;
            }

            return false;
        }
		private void detach_UserRoles(UserRole entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_UserRoles(UserRole entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
 partial void DeleteUserRole(UserRole instance);
 partial void UpdateUserRole(UserRole instance);
 partial void InsertUserRole(UserRole instance);