C#

How i will pass parameter & set it's type in API?

[HttpGet(\"{id:int}\")] public VillaDTO GetVilla(int id) { return VillaStore.villasList.FirstOrDefault(u => u.Id == id); } Here i set id which type int and passed the int type id ...

J
Joynal Abedin
3
        [HttpGet(\"{id:int}\")]
        public VillaDTO GetVilla(int id)
        {
            return VillaStore.villasList.FirstOrDefault(u => u.Id == id);
        }

Here i set id which type int and passed the int type id in GetVilla function.

J

Written by Joynal Abedin

Passionate about technology, code, and sharing knowledge.

0 Comments

Leave a Comment