角色是网站中都有的一个功能,用来区分用户的类型、划分用户的权限,这次实现角色列表浏览、角色添加、角色修改和角色删除。 一、业务逻辑层 1、角色模型 Ninesky.Core【右键】->添加->类,输入类名Role。 引用System.ComponentModel.DataAnnotations命名空间 using System.ComponentModel.DataAnnotations; namespace Ninesky.Core { /// /// 角色 /// public class Role { [Key] public