public List <Genre> FindAll() { using (var context = new IdentityExDbEntities()) { return(context.Genre_GetAllGenres().MapToModels()); } }
public List <Book> FindAll() { using (var context = new IdentityExDbEntities()) { return(context.Book_GetAllBooks().MapToModels()); } }
public int Add(Author item) { using (var context = new IdentityExDbEntities()) { return(context.Author_Insert(item.FirstName, item.LastName, item.DateCreated, item.UserCreated?.Id)); } }
public UserInfo FindBy(int key) { using (var context = new IdentityExDbEntities()) { return(context.UserInfoes.FirstOrDefault(user => user.Id == key)); } }
public List <UserInfo> FindAll() { using (var context = new IdentityExDbEntities()) { return(context.UserInfoes.ToList()); } }
public Author FindBy(int key) { using (var context = new IdentityExDbEntities()) { return(context.Author_Get(key).FirstOrDefault().MapToModel()); } }
public List <Author> FindAll() { using (var context = new IdentityExDbEntities()) { return(context.Authors.Select(s => s).ToList()); } }
public List <Author> FindAll() { using (var context = new IdentityExDbEntities()) { return(context.Author_GetAll().MapToModels()); } }
public Model.Authors.Author FindBy(int key) { using (var context = new IdentityExDbEntities()) { return(context.AuthorData_Get(key).SingleOrDefault().MapToModel()); } }
public int Add(Model.Authors.Author item) { using (var context = new IdentityExDbEntities()) { return(context.Author_Insert(item.FirstName, item.LastName, item.Note, item.Description, item.UserCreated?.Id)); } }
public int Add(Model.Subscriber.Subscriber item) { using (var context = new IdentityExDbEntities()) { return(context.Subscriber_GetAll().MapToModels()); } }
public Model.Authors.Author Save(Model.Authors.Author item) { using (var context = new IdentityExDbEntities()) { context.Author_Save(item.Id, item.FirstName, item.LastName, item.Note, item.Description, item.UserLastModified?.Id); return(item); } }
public bool Delete(Author item) { using (var context = new IdentityExDbEntities()) { context.Author_Delete(item.Id, item.LastModified, item.UserLastModified?.Id); } return(true); }
public Author Save(Author item) { using (var context = new IdentityExDbEntities()) { context.Author_Save(item.Id, item.FirstName, item.LastName, item.LastModified, item.UserLastModified?.Id); return(item); } }
public List <Model.Authors.Author> FindAll() { using (var context = new IdentityExDbEntities()) { List <Model.Authors.Author> list = new List <Model.Authors.Author>(); foreach (var item in context.Authors_Get().ToList()) { list.Add(item.MapToModels()); } return(list); } }
public int Add(Genre item) { using (var context = new IdentityExDbEntities()) { return(context.Genre_InsertGenre( item.DateCreated, item.UserCreated?.Id, item.Name, item.Description ).SingleOrDefault().GetValueOrDefault()); } }
public bool Delete(Model.Authors.Author item) { try { using (var context = new IdentityExDbEntities()) { context.Author_Delete(item.Id, item.UserLastModified?.Id); return(true); } } catch (Exception e) { Console.WriteLine($"The exception is: '{e}'"); return(false); } }
public Author Save(Author item) { using (var context = new IdentityExDbEntities()) { context.Author_Save(item.Id, item.FirstName, item.LastName, item.BirthDate, item.BirthPlace, item.DeathDate, item.DeathPlace, item.Description, item.Url, item.LastModified, item.UserLastModified?.Id); return(item); } }
public int Add(Author item) { using (var context = new IdentityExDbEntities()) { return(context.Author_Insert( item.FirstName, item.LastName, item.DateCreated, item.UserCreated?.Id, item.BirthDate, item.BirthPlace, item.DeathDate, item.DeathPlace, item.Description, item.Url ).SingleOrDefault().GetValueOrDefault()); } }