Giter Site home page Giter Site logo

xvxvdee / portfolio Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 52 KB

This repository contains a portfolio web application built with the C# MVC (Model-View-Controller) framework. The application showcases the use of a custom API to manage and display portfolio content.

C# 100.00%
csharp custom-api mongodb mvc-framework

portfolio's Introduction

Portfolio

portfolio's People

Contributors

xvxvdee avatar

Watchers

 avatar

portfolio's Issues

Projects Collection: Unable to get document by Id

Going straight to DocumentIdExceptionNotFound Error, when the Id exists

ResumeApiController.cs

  [HttpGet("resume/projects/{id}")]
  public async Task<ActionResult<string>> Projects(int id)
  { // TODO: Going straight to DocumentIdExceptionNotFound Error, when the Id exists
      try
      {
          var response = await this.dbService.GetProject(id);
          return Ok(response);
      }
      catch (BsonSerializationException ex)
      {
          Console.WriteLine(ex.Message);
          return Problem("Internal server error.");
      }
      catch (DocumentIdNotFoundException ex)
      {
          return NotFound(ex.Message);
      }
      catch (NullReferenceException ex)
      {
          System.Console.WriteLine($" Target = Project Collection: {ex.Message}");
          return Problem("Internal Service Error");
      }
      catch (MongoConnectionException ex)
      {
          System.Console.WriteLine($" Target = Project Collection: {ex.Message}");
          return Problem("Internal Service Error");
      }
  }

Check GetExperience() function in MongoDBService.cs:

 public async Task<string> GetExperience(int id) // Return document based on Id
 {
     var size = await this.experienceCollection.GetSize();
     var validation = this.inputToMongoDBService.CheckIdRange(id, size);
     if (validation)
     {
         var document = await this.experienceCollection.collection.Find(experienceCollection => experienceCollection.Id == id).FirstOrDefaultAsync();
         var json = document.ToJson();
         return json;
         throw new DocumentIdNotFoundException();
     }
     else
     {
         throw new DocumentIdNotFoundException();
     }
 }

Project / Experience Collection: Handling multi-word inputs and #

Endpoints only accepts one word as the resource identifier.

One word Example

image

Multi-word Example

{{HOST}}/deandra_spike-madden/resume/experience/skills/Microsoft Power BI returns an empty list.
image

C# Search

HOST/deandra_spike-madden/resume/experience/skills/C# returns all the documents in the collection due to the identifier fragment.
image

When serialized (HOST/deandra_spike-madden/resume/experience/skills/C%23) an empty list is returned.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.