Example #1
0
 public static Quotes ToOrmQuote(this DalQuote quote)
 {
     return(new Quotes
     {
         QuoteID = quote.ID,
         Collection_BookID = quote.CollectionBookID,
         Text = quote.Text
     });
 }
        public void AddQuote(DalQuote quote)
        {
            var dbCb = context.Collection_Book.FirstOrDefault(e => e.Collection_BookID == quote.CollectionBookID);

            if (dbCb != null)
            {
                context.Quotes.Add(quote.ToOrmQuote());
            }
        }
Example #3
0
 public static ServiceQuote ToServiceQuote(this DalQuote quote)
 {
     return(new ServiceQuote
     {
         ID = quote.ID,
         CollectionBookID = quote.CollectionBookID,
         Text = quote.Text
     });
 }
        public void DeleteQuote(DalQuote quote)
        {
            //var dbBook = context.Collection_Book.FirstOrDefault(e => e.Collection_BookID == collectionBook.ID);
            var dbQ = context.Quotes.FirstOrDefault(e => e.QuoteID == quote.ID);

            if (dbQ != null)
            {
                context.Quotes.Remove(dbQ);
            }
        }