
REST Web API in C#
- or -
Post a project like this2181
€90(approx. $106)
- Posted:
- Proposals: 13
- Remote
- #2663936
- Completed
Senior Software Engineer | Building Scalable Apps, Everywhere | Mobile, Web, Desktop | 15+ Years

.NET Developer | .Net | .Net Core | C# | ASP.Net | MVC | SQL | Web API |ReactJS |jQuery | Power Platform | Power Automate | Power BI |

WordPress Elementor Expert, Website Design and Development, Expertise in Wix, Shopify, Webflow, Bubble, Squarespace, Fron-End Development

Ranked Top 5 CERT in PPH with Microsoft GOLD partner | .NET Framework | Umbraco | PHP/WordPress | Native & Cross Platform Mobile App | MEAN | MERN

Working on .NET core, react, Azure, AWS, .NET, C#, WPF, Oracle , SSIS, react native, Design

34991137260481448813502797198775033532525047743046113316814770546535741246413
Description
Experience Level: Entry
I need a REST Web Api that implements the CRUD endpoints for any entity. The API must work with a JSON that contains the fields and values, and do the insert/update in the table that is indicated in the call. Also, it must do the read, reading from the table indicated and returning a JSON with the fields and values in the table. I mean, neither the table nor the fields are known at design time, API must get table name and fields name from the table itself and JSON. The primary key is always a integer autoincrement named "ID".
Database is MySQL.
Table sample:
create table TestTable (
ID int(11) auto_increment primary key,
Customer varchar(20) NOT NULL,
CustomerFullName varchar(100) NOT NULL,
CustomerOrder tinyint(4) null,
MinimumNumber int(11) not null,
MaximumNumber int(11) null,
CreateDate datetime null,
IsVIP bit(1) not null
);
JSON sample:
{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
For read one or more records:
POST /api/entities/{entityname}
Receives as post data a JSON with the fields to filter, eg: {"ID":1}
Return all records from tablename as an array:
[{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}]
If no field is provided, return all rows:
[{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}, {..}, {..}]
If no record matches, it will return an empty array: []
To create one record:
POST /api/entities/{entityname}
{"Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
Inserts a new record and returns the generated ID
To update one record:
PUT /api/entities/{entityname}
Receives a JSON with the data to update:
{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
To delete one record:
DELETE /api/entities/{entityname}
Receives a JSON with the key of the record to delete:
{"ID":1}
In all cases, returns a status 200 if everything is OK, and a status 202 if an error occurs.
If an error occurs, a JSON with the error message must be returned, eg {"Error":"Error description"}
Also, for update and delete, if the record is not found, it will return status 404.
Budget is approximate.
I must be able to compile and test the source code before paying.
Database is MySQL.
Table sample:
create table TestTable (
ID int(11) auto_increment primary key,
Customer varchar(20) NOT NULL,
CustomerFullName varchar(100) NOT NULL,
CustomerOrder tinyint(4) null,
MinimumNumber int(11) not null,
MaximumNumber int(11) null,
CreateDate datetime null,
IsVIP bit(1) not null
);
JSON sample:
{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
For read one or more records:
POST /api/entities/{entityname}
Receives as post data a JSON with the fields to filter, eg: {"ID":1}
Return all records from tablename as an array:
[{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}]
If no field is provided, return all rows:
[{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}, {..}, {..}]
If no record matches, it will return an empty array: []
To create one record:
POST /api/entities/{entityname}
{"Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
Inserts a new record and returns the generated ID
To update one record:
PUT /api/entities/{entityname}
Receives a JSON with the data to update:
{"ID":1, "Customer":"Customer1", "CustomerFullName":"John Smith", "CustomerOrder": 1, "MinimumNumber": 100, "CreateDate":"2019-06-01", "isVIP": 0}
To delete one record:
DELETE /api/entities/{entityname}
Receives a JSON with the key of the record to delete:
{"ID":1}
In all cases, returns a status 200 if everything is OK, and a status 202 if an error occurs.
If an error occurs, a JSON with the error message must be returned, eg {"Error":"Error description"}
Also, for update and delete, if the record is not found, it will return status 404.
Budget is approximate.
I must be able to compile and test the source code before paying.
Esther M.
100% (19)Projects Completed
18
Freelancers worked with
11
Projects awarded
76%
Last project
10 Nov 2020
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies