Release keys by supplying key model
This commit is contained in:
parent
6c2d65e284
commit
1834d0182e
1 changed files with 8 additions and 3 deletions
|
@ -29,13 +29,18 @@ namespace LANCommander.Services
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Release(Guid id)
|
public async Task<Key> Release(Guid id)
|
||||||
{
|
{
|
||||||
var key = await Get(id);
|
var key = await Get(id);
|
||||||
|
|
||||||
if (key == null)
|
if (key == null)
|
||||||
return;
|
return null;
|
||||||
|
|
||||||
|
return await Release(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Key> Release(Key key)
|
||||||
|
{
|
||||||
switch (key.AllocationMethod)
|
switch (key.AllocationMethod)
|
||||||
{
|
{
|
||||||
case KeyAllocationMethod.UserAccount:
|
case KeyAllocationMethod.UserAccount:
|
||||||
|
@ -49,7 +54,7 @@ namespace LANCommander.Services
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Update(key);
|
return await Update(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue