public bool UpdateUserContent(UserContentDto UserContent) { using (var db = GetConnection()) { db.Open(); var result = db.Execute(@"Update UserContent Set [UserId] = @UserId ,[UserBoardId] = @UserBoardId ,[UserDescription] = @UserDescription ,[IsPublic] = @IsPublic where [Id] = @Id", UserContent); return(result == 1); } }
public bool AddNewUserContent(UserContentDto input) { using (var db = GetConnection()) { db.Open(); var result = db.Execute(@"Insert into UserContent ([UserId] ,[ContentId] ,[UserBoardId] ,[UserDescription] ,[IsPublic]) Values (@UserId ,@ContentId ,@UserBoardId ,@UserDescription ,@IsPublic)", input); return(result == 1); } }
public bool Put([FromBody] UserContentDto userContent) { return(_repo.UpdateUserContent(userContent)); }
public bool Post([FromBody] UserContentDto input) { return(_repo.AddNewUserContent(input)); }