Esempio n. 1
0
        public User Create(User user)
        {
            var emp = dbContext.Users.Add(user);

            dbContext.SaveChanges();
            return(emp);
        }
 public string MoveFilesIntoFolder(long FolderId, List <File> files)
 {
     try
     {
         if (files != null)
         {
             foreach (var objfile in files)
             {
                 var existing = dbContext.Files.FirstOrDefault(x => x.FileId == objfile.FileId);
                 existing.FolderId = FolderId;
                 dbContext.SaveChanges();
             }
             return("File has been moved successfully.");
         }
         else
         {
             return("Internal server error");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }