Ejemplo n.º 1
0
 /// <summary>
 /// The purpose of this method is to take a db object and turn it into a model object
 /// </summary>
 /// <param name="book"></param>
 /// <returns></returns>
 public static Library.Models.Book Map(Entities.BookEntity book)
 {
     return(new Library.Models.Book {
         AuthorFirstName = book.AuthorFirstName,
         AuthorLastName = book.AuthorLastName,
         ISBN = book.Isbn,
         Price = book.Price,
         Title = book.Name,
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// The purpose of this method is to take a db object and turn it into a model object
 /// </summary>
 /// <param name="book"></param>
 /// <returns></returns>
 public static Domain.Models.Book Map(Entities.BookEntity book)
 {
     return(new Domain.Models.Book
     {
         AuthorFirstName = book.AuthorFirstName,
         AuthorLastName = book.AuthorLastName,
         ISBN = book.Isbn,
         Price = book.Price,
         Title = book.Name,
         Genre = new Domain.Models.Genre {
             ID = book.Genre.Id, Name = book.Genre.Name
         },
         Imagelink = book.ImageLink
     });
 }