Код: Выделить всё
public enum PermissionScope
{
OfflineAccess = "7427e0e9-2fba-42fe-b0c0-848c9e6a8182"; //ID 1
Profile = "14dad69e-099b-42c9-810b-d002981feec1"; //ID 2
}
Код: Выделить всё
string[] scopes = new[] { "offline_access", "Profile" };
foreach (var scope in scopes)
{
ResourceAccess resourceAccess = new ResourceAccess
{
Id = PermissionScope(scope), //id should have the values now: 7427e0e9-2fba-42fe-b0c0-848c9e6a8182 and in the 2nd run 14dad69e-099b-42c9-810b-d002981feec1
Type = "Scope"
};
}
- Я хочу получить строку «7427e0e9-2fba-42fe- b0c0-848c9e6a8182", записанный в идентификатор путем вызова PermissionScope.OfflineAccess
Подробнее здесь: https://stackoverflow.com/questions/793 ... tring-back
Мобильная версия