Encerrado

Fix simple problem in C# Web API

Im new to Web Api. I need help with creating a simple RESTful API (with Web api). I want to return blog posts by Id and by blog posts by category. But im getting this error:

"'PostController' already defines a member called 'Get' with the same parameter types"

How shall I solve this? Perhaps by attribute routing? Send me code how to solve this as per best practice.

BELOW IS CODE:

// GET api/values/5

[HttpGet("{id}")]

public JsonResult Get(int id)

{

return new JsonResult([login to view URL](id));

}

[HttpGet("{Find}")]

public JsonResult Get(string searchString)

{

return new JsonResult([login to view URL](searchString));

}

[HttpGet("{Category}")]

public JsonResult Get(string category)

{

return new JsonResult([login to view URL]());

}

As said, I´m new to Web API and I think the problem is very simple. If you know Web API this might take only 5 min to solve.

Habilidades: ASP.NET, Programação C#

Sobre o Cliente:
( 15 comentários ) Sweden, Sweden

ID do Projeto: #12511737

31 freelancers estão ofertando em média $59 nesse trabalho

Agiletechstudio

Greetings! A team of Professional ASP.NET experts are at your service to provide you the best quality work in time and within budget. We are Proficient in: Asp.Net, C#, Asp.Net-MVC, SQL Server, Web APIs, Web Servic Mais

$77 USD in 3 dias
(82 Comentários)
7.4
WebInfoSolutions

Are all these methods inside same Controller? Yes I can fix this in 5 mins.......................................

$10 USD in 0 dias
(103 Comentários)
7.1
shreesols

You are right thatvit would not take so much time. At the same time you would not have to award me too. Just ping me so that I can code here. When I will complete I will send you the source code and you can pay me. I Mais

$21 USD em 1 dia
(48 Comentários)
7.0
sherifamgadnabih

i am a lead .Net software engineer and responsible for creating web and desktop applications using different languages and technologies if u r interested just send me a message thank you and good luck

$25 USD em 1 dia
(129 Comentários)
6.9
arityinfoway

Hello Sir, I have gone through your requirements regarding Fix simple problem in C# Web API. we brief and understand your idea and preference for job as you are looking for. I have more than 6+ years of experienc Mais

$34 USD em 1 dia
(42 Comentários)
6.4
DavidLindon

A proposal has not yet been provided

$25 USD in 3 dias
(35 Comentários)
6.0
WebColorIn

can fix it! Lets Discuss? ❤ Ultra Fast Website + Certified Developer ❤ Replicate ANY site with high Fidelity. Well versed with latest greatest in design world. Flexible, Responsive, Dedicated and Rapid Application D Mais

$30 USD em 1 dia
(8 Comentários)
5.5
tungct

Hi, I am looking for your problem. And there is solution for your problem. If it helpful to you so please paid to me. Don't hesitates to ask me more. 1. You should use route attribute for your function member, and Mais

$35 USD em 1 dia
(20 Comentários)
5.5
amraltweky

Hello, Only change get method to be for example getbycategory, getbyid, getsearch Thanks Amr hafez

$10 USD in 0 dias
(21 Comentários)
4.8
amynkvirani

public JsonResult Get(string searchString) public JsonResult Get(string category) The above 2 function may be considered as same for the WebAPI. How about commenting out 1 of the above function and see if it works Mais

$10 USD in 0 dias
(27 Comentários)
4.7
rahimc4d

hi 1. you cannot use two overload with same type parameter. Get (int id) Get(string s, int I=0) { if I = 0 s is searchword if I = 1 s is catagory // then your code and resul } when u call, pass 0 or 1 according Mais

$25 USD em 1 dia
(28 Comentários)
4.5
binarycodeservic

Hi there - My name is Raju. I’ve read your brief and can see that you’d like to Fix Web Api issue. I have over 6 years experience of designing and developing applications for Asp.Net(MVC)/C#.Net/WPF/AngularJS/WebApi/MS Mais

$10 USD em 1 dia
(16 Comentários)
4.5
wasifmuneer

Hello, Please give me chance to work with you on this project, I am Microsoft Full Stack developer, having expertise on web based and desktop base application development, including mobile apps as well using Xamarin, Mais

$23 USD em 1 dia
(19 Comentários)
4.6
sumeetshah90

Hi, I am Sumeet Shah from India. I am an experienced Software Engineer with expertise in various Dot Net Framework Technologies and Frameworks. I can solve the problem in 30 minutes. Hence, would like to have Mais

$30 USD em 1 dia
(10 Comentários)
4.1
tuyenpt

Hi, Nice to meet you. Exactly as the error message, your code contains 3 triple functions with get name. You should create the different function or have an other way to load data. I have many year's experience Mais

$25 USD in 0 dias
(8 Comentários)
4.3
Nandanisharma

Dear concern, I am working as a Senior Developer. I have more than 5 years experience in this field. I am working on web-applications,mobile applications like Iphone, Anroid etc. I am sure that I can deliver you Mais

$35 USD em 1 dia
(5 Comentários)
3.8
maheshml13

hi i am expert in web api. I can do this hoping for positive response. Regards Mahesh

$25 USD in 2 dias
(6 Comentários)
3.5
toufiqelahy

need 2 minutes to solve this problem

$15 USD in 0 dias
(5 Comentários)
2.8
sarahmohammed87

Hi Sir, I can help you in your web Api methods , it will not take more than one hour ,can start with you immediately ,message me for more discuss . . . Regards,Sarah

$30 USD em 1 dia
(9 Comentários)
3.1
vietandigital

Hi,I am preferred freelancer and an experienced developer with vast experience in Experience in programming language C#, .NET Framework, ASP.NET, XML, Entity Framework 6 Strong programming knowledge in Visual Studio Mais

$30 USD in 2 dias
(2 Comentários)
2.6