Hi,
I implement one web api like this :
[Authorize]
[RoutePrefix("api/Notifications")]
public class NotificationsController : BaseController
{
private NotificationManager _notification = new NotificationManager();
[Route("")]
//api/notifications
public IEnumerable GetNotifications()
{
return GetNotifications();
}
}
[RoutePrefix("api/Notifications")]
public class NotificationsController : BaseController
{
private NotificationManager _notification = new NotificationManager();
[Route("")]
//api/notifications
public IEnumerable
{
return GetNotifications();
}
}
This is my dataaccess layer class :
public IEnumerable GetNotifications()
{
using (KiwiDbContext context = new KiwiDbContext(_ConnectionString))
{
return context.Notifications.ToList();
}
}
{
using (KiwiDbContext context = new KiwiDbContext(_ConnectionString))
{
return context.Notifications.ToList();
}
}
This is my business layer :
public class NotificationManager
{
private DataAccess _kiwidb = new DataAccess();
public ListGetNotification()
{
return _kiwidb.GetNotifications().ToList();
}
}
{
private DataAccess _kiwidb = new DataAccess();
public List
{
return _kiwidb.GetNotifications().ToList();
}
}
This is my table :
When I execute my project get an error like this :
An unhandled exception of type 'System.StackOverflowException' occurred in Kiwi.Service.API.Controller.dll
Please give me a correct code for that.

Manas MohapatraPosted Oct 2, 2015, 11:45 AM