.Net Core Master Details entry
-
Hello All, This is my first application in asp.net core Table Like this ->
PublisherMater : PublisherId,PublisherName,TotalBooks
PublisherDetails: BookName,ReleaseDate,AuthorNameMy question is : I want to manage master and details entry using asp.net core mvc with code first approch. first step : Create Model secound : Create MVC Controller with view using Entity Framework anybody have any example like this ? Thanks in advance
-
Hello All, This is my first application in asp.net core Table Like this ->
PublisherMater : PublisherId,PublisherName,TotalBooks
PublisherDetails: BookName,ReleaseDate,AuthorNameMy question is : I want to manage master and details entry using asp.net core mvc with code first approch. first step : Create Model secound : Create MVC Controller with view using Entity Framework anybody have any example like this ? Thanks in advance
Your tables are bad. You should not be putting "TotalBooks" in the PublisherMaster table at all. What you should be doing is something closer to this:
public class Publisher
{
public int PublisherId { get; set; }
public string PublisherName { get; set; }public ICollection PublishedBooks { get; set; }
}
public class Book
{
public int BookId { get; set; }
public string BookTitle { get; set; }
public string AuthorName { get; set; }
public Date? ReleaseDate { get; set; }
}Every publisher can publish any number of books, hence the collection in the class.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Hello All, This is my first application in asp.net core Table Like this ->
PublisherMater : PublisherId,PublisherName,TotalBooks
PublisherDetails: BookName,ReleaseDate,AuthorNameMy question is : I want to manage master and details entry using asp.net core mvc with code first approch. first step : Create Model secound : Create MVC Controller with view using Entity Framework anybody have any example like this ? Thanks in advance
The famous "Library Management" assignment (vs The Hospital Management System). (Couldn't find the "PUBS" database ... but I'm sure it's somewhere). [Library Management using ASP.Net MVC (Part 1) Books CRUD Function – alexcodetuts](https://alexcodetuts.com/2017/12/10/library-management-using-asp-net-mvc-part-1/)
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food