Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 35 additions & 11 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET
name: .NET Build and Test

on:
push:
branches: [ "main" ]
branches: [ main ]
pull_request:
branches: [ "main" ]
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install npm dependencies for client
run: npm install
working-directory: Tech2Gether_client/Tech2Gether_client

- name: Restore dependencies
run: dotnet restore
working-directory: Tech2Gether_api

- name: Build
run: dotnet build --no-restore
working-directory: Tech2Gether_api

- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: Tech2Gether_api

- name: Restore dependencies
run: dotnet restore
working-directory: Tech2Gether_client

- name: Build
run: dotnet build --no-restore
working-directory: Tech2Gether_client

- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: Tech2Gether_client
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*.sln.docstates
*.env

# Mac things
*.DS_Store

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

Expand Down
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/YourProject.csproj",
"/p:PublishProfile=site38439-WebDeploy"
]
}
]
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Tech2GetherWebsite

## Making Contributions
View our contributor guide [here](https://otccis.gitbook.io/student-help-docs/t2t/tech2gether-website)

View our [contributor guide here](https://otccis.gitbook.io/student-help-docs/t2t/tech2gether-website)

[Learn how to setup your environment here](https://otccis.gitbook.io/student-help-docs/t2t/setup-your-environment)
28 changes: 0 additions & 28 deletions Tech2Gether_api/Controllers/UserController.cs

This file was deleted.

49 changes: 0 additions & 49 deletions Tech2Gether_api/Program.cs

This file was deleted.

14 changes: 0 additions & 14 deletions Tech2Gether Website.sln → Tech2Gether_api/Tech2Gether_api.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tech2Gether_website", "Tech2Gether_website\Tech2Gether_website.csproj", "{9CC163C7-A56F-4BBF-801C-39FD813736D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tech2Gether_api", "Tech2Gether_api\Tech2Gether_api.csproj", "{E012947C-7180-4DAD-8E5D-B9D0007FC4C3}"
EndProject
Global
Expand All @@ -17,18 +15,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|x64.ActiveCfg = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|x64.Build.0 = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|x86.ActiveCfg = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Debug|x86.Build.0 = Debug|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|Any CPU.Build.0 = Release|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|x64.ActiveCfg = Release|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|x64.Build.0 = Release|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|x86.ActiveCfg = Release|Any CPU
{9CC163C7-A56F-4BBF-801C-39FD813736D2}.Release|x86.Build.0 = Release|Any CPU
{E012947C-7180-4DAD-8E5D-B9D0007FC4C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E012947C-7180-4DAD-8E5D-B9D0007FC4C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E012947C-7180-4DAD-8E5D-B9D0007FC4C3}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down
62 changes: 62 additions & 0 deletions Tech2Gether_api/Tech2Gether_api/Controllers/UserController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Tech2Gether_api.Data;
using Tech2Gether_api.IRepository;
using Tech2Gether_api.Models;
using Tech2Gether_api.Repository;

namespace Tech2Gether_api.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class UserController : ControllerBase
{
private readonly IUser repository;

// Constructor - inject dependencies instead of creating them
public UserController(T2TContext context, IConfiguration config)
{
repository = new UserDAL(context, config);
}


#region Get All Users Method
// Get: api/users
[HttpGet("GetAllUsers", Name = "GetAllUsers")]
public async Task<GetAllUsersResponseModel> GetAllUsers()
{
GetAllUsersResponseModel response = new GetAllUsersResponseModel();

List<User> users = new List<User>();

try
{
users = await Task.Run(() => repository.GetAllUsers());

if (users.Count != 0)
{
response.Status = true;
response.StatusCode = 200;
response.userList = users;
}
else
{
//there has been an error
response.Status = false;
response.Message = "Get Failed";
response.StatusCode = 0;
}
}
catch (Exception ex)
{
response.Status = false;
response.Message = "Get Failed";
response.StatusCode = 0;
//there has been an error
Console.WriteLine(ex.Message);
}
return response;
}
#endregion
}
}
Loading