You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
594 B
27 lines
594 B
using DbContextLib;
|
|
using Entities;
|
|
using Model;
|
|
namespace Model2Entities
|
|
{
|
|
public class DbDataManager : IDataManager
|
|
{
|
|
public Book GetBookById(long id)
|
|
{
|
|
List<BookEntity> books = new List<BookEntity>();
|
|
using (var context = new LibraryContext())
|
|
{
|
|
foreach (var i in context.BooksSet)
|
|
{
|
|
if (i.Id == id)
|
|
{
|
|
return i.ConvertToModel();
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|