Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
I am getting an error when fetching data from database
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Sivakumar
8y
392
1
Reply
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<Notification> GetNotifications()
{
return GetNotifications();
}
}
This is my dataaccess layer class :
public IEnumerable<Notification> GetNotifications()
{
using (KiwiDbContext context = new KiwiDbContext(_ConnectionString))
{
return context.Notifications.ToList();
}
}
This is my business layer :
public class NotificationManager
{
private DataAccess _kiwidb = new DataAccess();
public List<Notification>GetNotification()
{
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.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Connection to the database with dataset
Project work need help... presenting on 13th October, 2015