Exemple #1
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));
     }
 }
Exemple #2
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);
     }
 }
Exemple #3
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);
     }
 }