public async Task <IActionResult> GetNotifications([FromRoute] long id) { if (id == 0) { ModelState.AddModelError(ErrorResponses.InvalidId, string.Empty); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var listNotificationsCommand = new Jibberwock.Persistence.DataAccess.Commands.Notifications.ListNotifications(Logger, new DataModels.Tenants.Tenant() { Id = id }); var notifications = await listNotificationsCommand.Execute(SqlServerDataSource); if (notifications == null) { return(NotFound()); } else { return(Ok(notifications)); } }
public async Task <IActionResult> GetGlobalUserNotifications() { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var listNotificationsCommand = new Jibberwock.Persistence.DataAccess.Commands.Notifications.ListNotifications(Logger); var notifications = await listNotificationsCommand.Execute(SqlServerDataSource); return(Ok(notifications)); }