Пример #1
0
 public static bool AddAuthors(Dbo.Author e)
 {
     using (DataAccess.Author a = new DataAccess.Author())
     {
         a.Initializer();
         return(a.Add(e));
     }
 }
Пример #2
0
 public bool Add(Dbo.Author e)
 {
     try
     {
         T_Author t = new T_Author()
         {
             Firstname = e.Firstname,
             Name      = e.Name
         };
         Context.T_Author.Add(t);
         Context.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }