public static EBookAuthor AddAuthor(string name, AlexandriaEntities context) { EBookAuthor Author = (from author in context.EBookAuthors where author.Name == name select author).FirstOrDefault(); if (Author == null) { Author = new EBookAuthor(); Author.Name = name; context.AddToEBookAuthors(Author); } return Author; }
public BooksController() { this._dataBeastContext = new AlexandriaEntities(); }