public PermissionTypeDTO ToDTO(PermissionTypeEntity entity)
        {
            PermissionTypeDTO dto = new PermissionTypeDTO();

            dto.CreateTime  = entity.CreateTime;
            dto.Description = entity.Description;
            dto.Id          = entity.Id;
            dto.Name        = entity.Name;
            return(dto);
        }
Ejemplo n.º 2
0
        public async Task <bool> DelByNameAsync(string name)
        {
            using (MyDbContext dbc = new MyDbContext())
            {
                PermissionTypeEntity permissionType = await dbc.GetAll <PermissionTypeEntity>().SingleOrDefaultAsync(i => i.Name == name);

                if (permissionType == null)
                {
                    return(false);
                }
                permissionType.IsDeleted = true;
                await dbc.SaveChangesAsync();

                return(true);
            }
        }