Skip to content

Commit

Permalink
First API project push
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaleprachan committed Nov 29, 2020
0 parents commit 28f65dd
Show file tree
Hide file tree
Showing 94 changed files with 13,474 additions and 0 deletions.
Binary file added .vs/Roofcare APIs/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
985 changes: 985 additions & 0 deletions .vs/Roofcare APIs/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/Roofcare APIs/v16/.suo
Binary file not shown.
27 changes: 27 additions & 0 deletions Controllers/UserController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Roofcare_APIs.Data;
using Roofcare_APIs.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Roofcare_APIs.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class UserController : ControllerBase
{
private UserService _userService;
public UserController(RoofCareDbContext roofCareDbContext)
{
_userService = new UserService(roofCareDbContext);
}
[HttpGet]
public IActionResult Get()
{
return Ok(UserService.getUsers());
}
}
}
27 changes: 27 additions & 0 deletions Data/RoofCareDbContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore;
using Roofcare_APIs.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Roofcare_APIs.Data
{
public class RoofCareDbContext : DbContext
{
public RoofCareDbContext(DbContextOptions<RoofCareDbContext> options) : base(options)
{

}

public DbSet<User> Users { get; set; }
public DbSet<Booking> Bookings { get; set; }
public DbSet<Favorite> Favorites { get; set; }
public DbSet<Feedback> Feedbacks { get; set; }
public DbSet<Offer> Offers { get; set; }
public DbSet<OfferReport> OfferReports { get; set; }
public DbSet<Profession> Professions { get; set; }
public DbSet<SavedOffer> SavedOffers { get; set; }
public DbSet<UserProfession> UserProfessions { get; set; }
}
}
Loading

0 comments on commit 28f65dd

Please sign in to comment.