public static bool AddAuthors(Dbo.Author e) { using (DataAccess.Author a = new DataAccess.Author()) { a.Initializer(); return(a.Add(e)); } }
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); } }