Exemple #1
0
        public static void AddAuthor(Author author)
        {
            Dictionary<long, string> fromCache = cachedAuthors;
            if (fromCache.ContainsKey(author.ID))
                return;

            fromCache.Add(author.ID, author.ToString());
        }
Exemple #2
0
 public static void UpdateAuthor(Author author)
 {
     using (Data.LibraryDataContext ctx = new LibraryDataContext())
     {
         ctx.Authors.Attach(author);
         ctx.Entry(author).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Exemple #3
0
 public static void UpdateAuthor(Author author)
 {
     Dictionary<long, string> fromCache = cachedAuthors;
     if (fromCache.ContainsKey(author.ID))
         fromCache[author.ID] = author.ToString();
     else
         fromCache.Add(author.ID, author.ToString());
 }