public override void CreateRole(string roleName) { var role = new Role(); role.Name = roleName; var userDa = new UserDa(databasecontext); //if new userDa.AddRole(role); }
public void SaveRole(int id, string Name) { var role = id > 0 ? GetRoleById(id) : new Role(); role.Name = Name; var userDa = new UserDa(databasecontext); //if new if (id < 1) userDa.AddRole(role); //update else userDa.UpdateRole(role); }