예제 #1
0
 public List <Genre> FindAll()
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Genre_GetAllGenres().MapToModels());
     }
 }
예제 #2
0
 public List <Book> FindAll()
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Book_GetAllBooks().MapToModels());
     }
 }
예제 #3
0
 public int Add(Author item)
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Author_Insert(item.FirstName, item.LastName, item.DateCreated, item.UserCreated?.Id));
     }
 }
예제 #4
0
 public UserInfo FindBy(int key)
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.UserInfoes.FirstOrDefault(user => user.Id == key));
     }
 }
예제 #5
0
 public List <UserInfo> FindAll()
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.UserInfoes.ToList());
     }
 }
예제 #6
0
 public Author FindBy(int key)
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Author_Get(key).FirstOrDefault().MapToModel());
     }
 }
예제 #7
0
 public List <Author> FindAll()
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Authors.Select(s => s).ToList());
     }
 }
예제 #8
0
 public List <Author> FindAll()
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Author_GetAll().MapToModels());
     }
 }
예제 #9
0
 public Model.Authors.Author FindBy(int key)
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.AuthorData_Get(key).SingleOrDefault().MapToModel());
     }
 }
예제 #10
0
 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));
     }
 }
예제 #11
0
 public int Add(Model.Subscriber.Subscriber item)
 {
     using (var context = new IdentityExDbEntities())
     {
         return(context.Subscriber_GetAll().MapToModels());
     }
 }
예제 #12
0
 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);
     }
 }
예제 #13
0
 public bool Delete(Author item)
 {
     using (var context = new IdentityExDbEntities())
     {
         context.Author_Delete(item.Id, item.LastModified, item.UserLastModified?.Id);
     }
     return(true);
 }
예제 #14
0
 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);
     }
 }
예제 #15
0
 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);
     }
 }
예제 #16
0
        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());
            }
        }
예제 #17
0
 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);
     }
 }
예제 #18
0
 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);
     }
 }
예제 #19
0
 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());
     }
 }