Skip to content

Web Api Application written in .Net Core 3.1, using RestfulApi, Entity Framework and MSSQL

Notifications You must be signed in to change notification settings

nekiro/Company-Web-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Company Web Api

Company Web Api is a simple Web Api Console App, which let you create new companies and manage them. Companies and their employees are saved in relational database. Aditionally requests are protected by Base64 basic authentication. Authentication header is following:

Basic <encodedBase64 admin:admin>

This was originally written for a job interview, but they said I'm not good enough :(

Technologies:

  • .Net Core 3.1
  • Restful Api
  • C#
  • MSSQL
  • Entity Framework

Supported requests

POST /company/create
{
    "Name": "<string>",
    "EstablishmentYear”: <integer>,
    "Employees": [{
        "FirstName": "<string>",
        "LastName": "<string>",
        "DateOfBirth": "<DateTime>",
        "JobTitle": "<string(enum)>"
    }, ... ]
}

Answer

{
    "Id”: <long>
}

 

POST /company/search
{
    "Keyword": "<string>",
    "EmployeeDateOfBirthFrom": "<DateTime?>",
    "EmployeeDateOfBirthTo": "<DateTime?>",
    "EmployeeJobTitles": [“<string(enum)>”, ...]
}

Answer

[{
        "Name": "<string>",
        "EstablishmentYear”: <integer>,
        "Employees": [{
        "FirstName": "<string>",
        "LastName": "<string>",
        "DateOfBirth": "<DateTime>",
        "JobTitle": "<string(enum)>"
}, ...]

 

PUT /company/update/<id>
{
    "Name": "<string>",
    "EstablishmentYear”: <integer>,
    "Employees": [{
        "FirstName": "<string>",
        "LastName": "<string>",
        "DateOfBirth": "<DateTime>",
        "JobTitle": "<string(enum)>"
    }, ...]
}

 

PUT /company/delete/<id>