Authors: Ariel R. Pedraza, Luay Younus, Dustin Mundy
Version: 1.0.0
An API created from scratch used to request and modify a database of blademaster weapons for the game Monster Hunter Generations with CRUD routes.
The following are required to run the program locally.
- Visual Studio 2017 Community with .NET Core 2.0 SDK
- GitBash / Terminal or GitHub Extension for Visual Studio
- Clone the repository to your local machine.
- Cd into the application directory where the
MonsterHunterAPI.slnexist. - Open the application using
Open/Start MonsterHunterAPI.sln.
- Once the App is opened, Right click on the application name from the
Solution Explorer Windowand selectAdd->New Item-> findASP.NET Configuration Fileand open add it to the project.
- Inside this file, change the Connection String to the following to connect to database
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=TaskDB;Trusted_Connection=True;MultipleActiveResultSets=true"
}- Click
Tools->NuGet Package Manager->Package Manager Consolethen run the following commands in the console.
- Install-Package Microsoft.EntityFrameworkCore.Tools
- Add-Migration Initial
- Update-DatabaseGetting all Blades from the Database
GET: /api/blade/Getting a single Blade by ID. This endpoint will return a list of materials in the returned Blade object
GET: /api/blade/:bladeIdFiltering list of blades by Weapon Or/And Element Or/And Rarity
GET: /api/blade/:weaponClass/:element/:rarityPost/Create a new Weapon/Blade on the Database
POST: api/bladeUpdate a blade/weapon
PUT: api/blade/:idDelete a blade from the database
DELETE: api/blade/:id[
{
"id": 1,
"parent": null,
"hasChild": true,
"weaponClass": "Long Sword",
"name": "Iron Katana 1",
"description": "A Long Sword forged with Eastern methods. Durable and resilient, but requires regular upkeep.",
"rawDamage": 70,
"elementType": null,
"elementDamage": 0,
"sharpness": "Yellow",
"rarity": 1,
"affinity": 0,
"slots": 0,
"defense": 0,
"imgUrl": null,
"materials": null
},
{
"id": 2,
"parent": {
"id": 1,
"parent": null,
"hasChild": true,
"weaponClass": "Long Sword",
"name": "Iron Katana 1",
"description": "A Long Sword forged with Eastern methods. Durable and resilient, but requires regular upkeep.",
"rawDamage": 70,
"elementType": null,
"elementDamage": 0,
"sharpness": "Yellow",
"rarity": 1,
"affinity": 0,
"slots": 0,
"defense": 0,
"imgUrl": null,
"materials": null
}
}
]Getting all materials from Database
GET: /api/materialGetting one material by ID
GET: /api/material/:idPosting a material with a list of locations
POST: /api/material[
{
"id": 1,
"name": "Iron Ore",
"rarity": 4,
"description": null,
"quantity": 0,
},
{
"id": 2,
"name": "Earth Crystal",
"rarity": 4,
"description": null,
"quantity": 0
},
{
"id": 3,
"name": "Disc Stone",
"rarity": 4,
"description": null,
"quantity": 0
},
{
"id": 4,
"name": "Machalite Ore",
"rarity": 4,
"description": null,
"quantity": 0
}
]Getting All Locations from Database
GET: /api/locationGetting one Location by ID
GET: /api/:locationIdCreating a new Location
A location object requires properties of Name and Area
POST: api/LocationUpdate an existing Location
PUT: api/Location/:idDelete a location
DELETE: api/Location/:id[
{
"id": 1,
"name": "The Forrest",
"area": 5,
"dropRate": 13,
"action": "mining"
},
{
"id": 2,
"name": "The Hill",
"area": 12,
"dropRate": 4,
"action": "climbing"
}
]- Entity Framework Core
- ASP.NET Core
- Swashbuckle
- Xunit
C# ASP.NET Core MVC Application
