Beispiel #1
0
        public FileEbook Add(FileEbook file)
        {
            var sqlQuery = "INSERT INTO FileDetails (FileName, FileContent) VALUES(@FileName, @FileContent); " + "SELECT CAST(SCOPE_IDENTITY() as int)";
            var FileId   = this._db.Query <int>(sqlQuery, file).Single();

            file.Id = FileId;
            return(file);
        }
Beispiel #2
0
        public FileEbook Update(FileEbook file)
        {
            var sqlQuery =
                "UPDATE FileDetails " +
                "SET FileName = @FileName, " +
                " FileContent = @FileContent " +
                "WHERE Id = @Id";

            this._db.Execute(sqlQuery, file);
            return(file);
        }