public async Task <int> AddFiles(Files files) { try { using (var context = new DBDataIfxContext()) { context.Files.Add(files); await context.SaveChangesAsync(); return(files.Id); } } catch (Exception) { return(-1); } }
public async Task <int> AddFolder(Folder folder) { try { using (var context = new DBDataIfxContext()) { context.Folder.Add(folder); await context.SaveChangesAsync(); return(folder.Id); } } catch (Exception) { return(-1); } }