Esempio n. 1
0
 internal static Livre Mapping(MLivre livre)
 {
     return(new Livre()
     {
         auteur = livre.Author,
         titre = livre.Title,
         description = livre.Summary,
         isbn = livre.isbn13,
         url_image = livre.UrlImage,
         genre = livre.Genre
     });
 }
Esempio n. 2
0
 public int addBook(MLivre livre)
 {
     using (var ctx = new modelEntities())
     {
         ctx.Livre.Add(new Livre()
         {
             titre       = livre.Title,
             auteur      = livre.Author,
             isbn        = livre.isbn13,
             description = livre.Summary,
             genre       = livre.Genre,
             url_image   = livre.UrlImage
         });
         return(ctx.SaveChanges());
     }
     return(-1);
 }