public AlertModule(IAlertRepository alertRepository) { Get["/api/alerts"] = parameters => { var user = (User)Context.CurrentUser; return(new { alerts = alertRepository .FindAll(user.Id) .Select(x => new { contractCode = x.ContractCode, lateDays = x.LateDays, clientName = x.ClientName, amount = x.Amount, loanOfficer = x.LoanOfficer, branchName = x.BranchName, phone = x.Phone, address = x.Address, city = x.City }) }); }; }