private void SetUpData() { account = ObjectFactory.CreateAccount(); context.Add(account); context.SaveChanges(); context.DropState(); }
private void SetUpData() { role = ObjectFactory.CreateRole(); foreach (String controller in new[] { "Roles", "Profile" }) { foreach (String action in new[] { "Edit", "Delete" }) { RolePermission rolePermission = ObjectFactory.CreateRolePermission(role.Permissions.Count + 1); rolePermission.Permission.Area = controller == "Roles" ? "Administration" : null; rolePermission.Permission.Controller = controller; rolePermission.Permission.Action = action; rolePermission.RoleId = role.Id; rolePermission.Role = null; role.Permissions.Add(rolePermission); } } context.Add(role); context.SaveChanges(); context.DropState(); }