Website openantrag.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
OpenAntrag/OpenAntrag/Controllers/NotificationsApiController.vb

33 lines
938 B

Imports System.Net
Imports System.Web.Http
Imports Raven.Client.Util
Public Class NotificationsApiController
Inherits ApiController
Public Function GetTypeList() As IEnumerable(Of KeyValueObject)
Dim values() As Integer = CType([Enum].GetValues(GetType(NotificationTypes)), Integer())
Dim query = From v As Integer In values
Select New KeyValueObject With {.Key = v,
.Value = Notifications.GetTypeStringPlural(v)}
Return query
End Function
Public Function GetLast(count As Integer) As IEnumerable(Of Notification)
Return Notifications.GetItemsPage(-1, 1, count)
End Function
Public Function GetLastByType(typeId As Integer,
count As Integer) As IEnumerable(Of Notification)
Return Notifications.GetItemsPage(typeId, 1, count)
End Function
End Class