public void fileCache(int fileID, int hash) { var file = _db .FileCache .Where(f => f.FileID == fileID) .FirstOrDefault(); if (file == null) { file = new FileHash { FileID = fileID, Hash = hash }; _db.FileCache.Add(file); } else { file.Hash = hash; } _db.SaveChanges(); }
public void fileCache(int fileID, int hash) { var file = _db .FileCache .Where(f => f.FileID == fileID) .FirstOrDefault(); if (file == null) { file = new FileHash { FileID = fileID, Hash = hash }; _db.FileCache.Add(file); } else file.Hash = hash; _db.SaveChanges(); }