TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sivakumar
NA
551
219.8k
I am getting an error when fetching data from database
Oct 2 2015 7:15 AM
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.
Reply
Answers (
1
)
Connection to the database with dataset
Project work need help... presenting on 13th October, 2015