How to modernize current dotnet REST API to MCP Server

This blog post is a How-To guide based on what I’ve learned from various sources and my experience trying MCP. If you’re using .NET and have existing code that you want to convert into an MCP Server, what steps do you need to take? Let’s dive in and find out. For Thai Version: มาลองปรับ Code .NET(REST API) เดิมเป็น MCP Server What is MCP? MCP, or Model Context Protocol, is a universal standard designed to extend the capabilities of AI Models (LLMs). This addresses the inherent limitations of models, which have finite knowledge and can sometimes hallucinate information. Prior to MCP,…

วาร์ปมาจด AI Community Day Bangkok 2025

ที่เรียกว่าวาร์ป เพราะ วันนี้เป็นวันที่จัด Tech Meetup ชนกัน 5 งานครับ ผมเองออกมาจากงาน .NET Conf Thailand 2025 มาฟังงานนี้ต่อครับ เหตุผลสั้นๆ อยากมา Cleverse เป็น Host ที่จัดงานหลายครั้งแล้ว ฮ่าๆ ที่ฟังมา เหมือนเป็น บ ที่ปั๊น Startup หลายๆ แบบ Mar-Tech หา user engage / Retail Tech / logistic tech (PanTruck) key ลดการตีรถเปล่า / เว็บรายงานผลการเลือกตั้ง และ AI Tech – aerogram.ai ให้ AI มันง่ายสำหรับ End User สำหรับ Plan อยากมาฟังหัวข้อส่วนแรก Coding ครับ อันหลังๆทำใจๆไว้แล้วธาตุไฟเข้าแทรกได้แน่ๆครับ สำหรับที่จดๆมามีหัวข้อตามนี้ครับผม AI Agents with Microsoft Foundry Speaker Teerasej Jiraphatchandej Building AI Agents for Agentic Commerce Speaker Sathapon Patanakuha 📌 Key Characteristic ของ AI Agents – Autonomy (จัดการได้เลยระดับนึง) / Preception (เห็นสภาพแวดล้อมมี Inputs) / Decision maeking with reasoning / Action / Adaptility (Learning) 📌…

สรุปงาน .NET Conf TH 2025

สำหรับวันนี้จะเป็นสรุปแบบลูกผสมนะครับ คนละครึ่ง OnSite 50% / Online 50% พอดีมีแว๊บๆไปอีกงาน dotnetconf เป็นงานที่จัดพร้อมกัน หลังงาน Global จัดตอนช่วงกลางเดือน nov ในไทยมีจัดตั้งแต่ปี 2018 แล้วครับ ผมเขียน Blog นะไว้บางปีนะ ปีนีจัดที่ seven peak (ทำ digital transformation) โดยหัวในงานปีนี้มีน่าสนใจหลายอย่างเลยครับ ตั้งแต่การเปิดตัว  net10 + vs2026 และหัวข้ออื่นในด้าน testing / azure / aspire / ai agent / unity / บราๆ ที่จดๆมาประมาณนี้ครับ Keynote Speaker Vasupon Thankakan 📌 Recap Microsoft Ignite Empowering Developer ในส่วน Developer โดย Key “How Microsoft can empower developer to achieve more” โดยที่มี AI มาเป็นตัวเร่ง 📌 ปี 2028 Garther คาดการณ์ไว้ว่า งาน day to day operation อย่างน้อย 15% จะถูกจัดการ โดน agentic ai 📌 สิ่งที่ Microsoft เตรียมมาให้มี 2 มุม 1 Agent build Stuff for you 📌 Wave…

[NET] Dockerfile for Blazer WASM

ตอนแรกที่ทำ Blazer ผมเข้าใจว่าตอน Pack เป็น Container มันใช้ Dockerfile ทำ Multi-Stage แบบปกติตามนี้แหละ ปรากฏว่า มันรันได้ แต่ไม่มีหน้าเว็บออกมาเลย ซึ่งมันผิดวิธีครับ Blazer WASM มัน Run ที่ Client เหมือนพวก html javascript นี้แหละ เลยต้องใช้ท่าทำ container พวกเอา frontend ไปใส่ โดยใช้ ตัวอย่างเต็มๆ ลองแงะจาก repo นี้ได้ครับ

แวะมาพบเพื่อน Golang Beyond Meetup 2025 @KKP

ผมได้ได้เชี่ยว Go นะ อาจจะผิดได้แวะมาพบน้องที่เคยทำงานด้วยกัน เลยมาพบในงาน และจดๆนิดหน่อยครับ Common Mistakes in Go and How to Avoid Them Speaker Bhuridech Sudsee 📌 Ignore to check if ok 📌 Unintend shadow variable 📌context – หัวข้อถัดไป The Art of Context: How to Use Context Properly 📌No graceful shutdown 📌 overuser init function 📌 defer thining 📌 Returning interface 📌 Accept Struct 📌 Sophisticated Dependency Injection ผมว่าคล้ายกับอันนี้ หัวข้อนี้นะ Dependency Injection in Golang Ref book 100 hundred mistake in Go The Art of Context: How to Use Context Properly Speaker Jirayut Khantavee 📌 ปัญหา เราจะรู้ได้ยังไง ว่าแต่ละ microservice / go rountine ทำงานยังได้ ตามที่เรากำหนดไหม ตัว Context จะมาช่วยตรงนี้ 📌 Use…

มาลองปรับ Code .NET(REST API) เดิมเป็น MCP Server

ใน Blog นี้มาจด How To หลังจากที่ได้ฟังมาหลายๆที่ และลอง MCP ถ้าเป็น dotnet ถ้าเรามี Code เดิมอยู่แล้ว อยากมาปรับให้ตัวมันเองเป็น MCP Server ต้องทำอย่างไรบ้าง ลองตามมาอ่านกันครับ MCP คือ อะไร ? MCP หรือ Model Context Protocol เป็นมาตรฐานกลางที่ช่วยให้ AI Model (LLM) มันมีความสามารถเพิ่มขึ้น เพราะข้อจำกัดของ Model มีองค์ความรู้จำกัด และข้อมูลบางอัน อาจจะมีการมโน (hallucination) ได้ ซึ่งก่อนที่จะมี MCP ถ้าเราอยากให้ LLM มันรู้จักกับ Tools/Service ที่เราทำไว้ไว้ ต้องไปเขียนวิธีการเชื่อมต่อตามที่ AI Model (LLM) แค่ละค่ายนั้นกำหนดขึ้นมาเอง หรือ แต่ละ Library ที่กำหนดไว้ ถ้าเรามีเปลี่ยน Model อย่างจาก GPT > Claude > Qwen มีกรี๊ดสิครับ MCP เลยมาเป็นคำตอบ ทำมาตรฐานกลางเลย ให้ทุกคนเชื่อมได้ง่าย และ AI Model (LLM) เอาไป Implement ด้วยนั่นเองครับ โดยก่อนที่เราใช้ MCP ได้ อย่างแรกที่ต้องคิดถึงก่อน เลือก Model ที่มีความสามารถ Function / Tools Calling หลังจากที่ AI Model (LLM) มันรู้จัก Tools มันจะช่วยแก้ปัญหา องค์ความรู้จำกัด และลดการมโนได้ อาทิ เช่น 🔴 เรื่องของเวลา ปกติ…

DevExpress XtraReport Hide Header on Last Page If no record

I’ve been reviewing code from a junior team member who developed an API for generating reports using DevExpress XtraReport. During re-testing before sending it to QA, I noticed that on the last page, there’s no data, but the system still prints out the column headers. 📌 Hide Page Header Create an expression for the PageHeader.Visible property as shown below Sample Step in Report Designer 📌 Hide Group Header Create an expression for the GroupHeaderBand.Visible property as shown below Reference

[DevExpress] XtraReport – XRPictureBox Relative ImageUrl Path

สำหรับวันนี้มาเจอ Code Report หลังจากเผามา 3-4 เดือนที่ผ่านมา แล้วพบว่าทุก Report รูป Logo Fixed Path หมดเลย ถ้าดูจาก xml ของ report พบว่า ถ้าดูจาก Code พบว่ามันจะ Lock Path C:\ฺNineYCom\CTD\Report\Logo\Logo_Landscape.jpg ถ้าเกิดต้องไปลองที่อื่น หรือใช้เป็น Container มันจะแบบเราหา Drive C ได้ที่ไหน ? มีแต่ /var /usr เป็นต้น หลังจากลอง Research พบว่าตัว DevExpress มันบอก Base Path แล้วไป map เป็น แบบ Relative Path ได้ครับ โดยไปเพิ่ม “DXResourceDirectory” แล้ว Load เข้ามา และเขียน Code ที่ main หรือ program.cs เพื่อกำหนด ดังนี้ หรือ แบบ webapi เขียนเต็มๆ ตามนี้ จากนั้นที่ Code ของ Report ไปแก้ ImageUrl จาก Full Path มาเป็นแบบ Relative Path ตามรูป สำหรับวิธีนี้ข้อดี App ของเรา Dynamic มากขึ้น ไม่ต้องมา Fixed Path ลงทุกที่ แต่ข้อเสียมันมีเหมือนกัน ต้องตรวจสอบนิดนึงมัน เปิดช่องให้ดึง Data อาจจะอันตรายมาด้วย แต่มีแนวทางแนะนำตามนี้ Reference