├── README.md
├── FlightTicketApi-FinalProject
├── appsettings.Development.json
├── appsettings.json
├── Helpers
│ └── SeatPrices.cs
├── DataRepository
│ ├── FlightsRepo.cs
│ └── TicketsRepo.cs
├── Entities
│ ├── Abstracts
│ │ └── ISeat.cs
│ └── Concretes
│ │ ├── RegularSeat.cs
│ │ ├── BusinessSeat.cs
│ │ ├── Ticket.cs
│ │ └── Flight.cs
├── FlightTicketApi-FinalProject.csproj
├── Program.cs
├── Properties
│ └── launchSettings.json
├── Business
│ ├── FlightService.cs
│ ├── TicketService.cs
│ └── SeatService.cs
├── Startup.cs
└── Controllers
│ ├── TicketController.cs
│ └── FlightController.cs
├── .dockerignore
├── Dockerfile
├── LICENSE.txt
├── FlightTicketApi-FinalProject.sln
├── .vscode
├── launch.json
└── tasks.json
├── .gitattributes
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # FlightTicketApi-FinalProject
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Helpers/SeatPrices.cs:
--------------------------------------------------------------------------------
1 | namespace FlightTicketApi_FinalProject.Helpers
2 | {
3 | ///
4 | /// Represents the prices for different seat types.
5 | ///
6 | public struct SeatPrices
7 | {
8 | public const double Business = 10.00;
9 | public const double Regular = 7.00;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.classpath
2 | **/.dockerignore
3 | **/.env
4 | **/.git
5 | **/.gitignore
6 | **/.project
7 | **/.settings
8 | **/.toolstarget
9 | **/.vs
10 | **/.vscode
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/bin
15 | **/charts
16 | **/docker-compose*
17 | **/compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
26 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/DataRepository/FlightsRepo.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Entities.Concretes;
2 | using System.Collections.Generic;
3 |
4 | namespace FlightTicketApi_FinalProject.DataRepository
5 | {
6 | public static class FlightsRepo
7 | {
8 | ///
9 | /// Gets or sets the list of flights in the repository.
10 | ///
11 | public static List Flights { get; set; } = new List();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/DataRepository/TicketsRepo.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Entities.Concretes;
2 | using System.Collections.Generic;
3 |
4 | namespace FlightTicketApi_FinalProject.DataRepository
5 | {
6 | public static class TicketsRepo
7 | {
8 | ///
9 | /// Gets or sets the list of tickets in the repository.
10 | ///
11 | public static List Tickets { get; set; } = new List();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Entities/Abstracts/ISeat.cs:
--------------------------------------------------------------------------------
1 | namespace FlightTicketApi_FinalProject.Entities.Abstracts
2 | {
3 | public interface ISeat
4 | {
5 | public int SeatRow { get; set; }
6 | public string SeatColumn { get; set; }
7 | public bool IsAvailable { get; set; }
8 | public double Price { get; set; }
9 | }
10 |
11 | ///
12 | /// Represents the characters used to label columns in a flight.
13 | ///
14 | public enum ColumnCharacters
15 | {
16 | A, B, C, D, E, F,
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | FlightTicketApi_FinalProject
6 | True
7 | Linux
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Entities/Concretes/RegularSeat.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Entities.Abstracts;
2 | using FlightTicketApi_FinalProject.Helpers;
3 |
4 | namespace FlightTicketApi_FinalProject.Entities.Concretes
5 | {
6 | public class RegularSeat : ISeat
7 | {
8 | public int SeatRow { get; set; }
9 | public string SeatColumn { get; set; }
10 | public bool IsAvailable { get; set; }
11 | public double Price { get; set; }
12 |
13 | public RegularSeat()
14 | {
15 | this.IsAvailable = true;
16 | this.Price = SeatPrices.Regular;
17 | }
18 |
19 | public RegularSeat(int seatRow, string seatColumn) : this()
20 | {
21 | this.SeatRow = seatRow;
22 | this.SeatColumn = seatColumn;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Entities/Concretes/BusinessSeat.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Entities.Abstracts;
2 | using FlightTicketApi_FinalProject.Helpers;
3 |
4 | namespace FlightTicketApi_FinalProject.Entities.Concretes
5 | {
6 | public class BusinessSeat : ISeat
7 | {
8 | public int SeatRow { get; set; }
9 | public string SeatColumn { get; set; }
10 | public bool IsAvailable { get; set; }
11 | public double Price { get; set; }
12 |
13 | public BusinessSeat()
14 | {
15 | this.IsAvailable = true;
16 | this.Price = SeatPrices.Business;
17 | }
18 |
19 | public BusinessSeat(int seatRow, string seatColumn) : this()
20 | {
21 | this.SeatRow = seatRow;
22 | this.SeatColumn = seatColumn;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Hosting;
2 | using Microsoft.Extensions.Configuration;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 |
10 | namespace FlightTicketApi_FinalProject
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
4 | WORKDIR /app
5 | EXPOSE 80
6 |
7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
8 | WORKDIR /src
9 | COPY ["FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj", "FlightTicketApi-FinalProject/"]
10 | RUN dotnet restore "FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
11 | COPY . .
12 | WORKDIR "/src/FlightTicketApi-FinalProject"
13 | RUN dotnet build "FlightTicketApi-FinalProject.csproj" -c Release -o /app/build
14 |
15 | FROM build AS publish
16 | RUN dotnet publish "FlightTicketApi-FinalProject.csproj" -c Release -o /app/publish /p:UseAppHost=false
17 |
18 | FROM base AS final
19 | WORKDIR /app
20 | COPY --from=publish /app/publish .
21 | ENTRYPOINT ["dotnet", "FlightTicketApi-FinalProject.dll"]
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Entities/Concretes/Ticket.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Entities.Abstracts;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace FlightTicketApi_FinalProject.Entities.Concretes
6 | {
7 | public class Ticket
8 | {
9 | public string TicketToken { get; set; }
10 | public string FlightNumber { get; set; }
11 | public string Departure { get; set; }
12 | public string Arrival { get; set; }
13 | public DateTime FlightTime { get; set; }
14 | public ISeat SelectedSeat { get; set; }
15 | public double price { get; set; }
16 | public Ticket() { }
17 | public Ticket(Flight flight, ISeat selectedSeat, double price)
18 | {
19 | this.TicketToken = Guid.NewGuid().ToString();
20 | this.FlightNumber = flight.FlightNumber;
21 | this.Departure = flight.DepartureCity;
22 | this.Arrival = flight.ArrivalCity;
23 | this.FlightTime = flight.FlightTime;
24 | this.price = price;
25 | this.SelectedSeat = selectedSeat;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "IIS Express": {
4 | "commandName": "IISExpress",
5 | "launchBrowser": true,
6 | "launchUrl": "swagger",
7 | "environmentVariables": {
8 | "ASPNETCORE_ENVIRONMENT": "Development"
9 | }
10 | },
11 | "FlightTicketApi_FinalProject": {
12 | "commandName": "Project",
13 | "launchBrowser": true,
14 | "launchUrl": "swagger",
15 | "environmentVariables": {
16 | "ASPNETCORE_ENVIRONMENT": "Development"
17 | },
18 | "applicationUrl": "http://localhost:5000"
19 | },
20 | "Docker": {
21 | "commandName": "Docker",
22 | "launchBrowser": true,
23 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
24 | "publishAllPorts": true
25 | }
26 | },
27 | "$schema": "http://json.schemastore.org/launchsettings.json",
28 | "iisSettings": {
29 | "windowsAuthentication": false,
30 | "anonymousAuthentication": true,
31 | "iisExpress": {
32 | "applicationUrl": "http://localhost:51259",
33 | "sslPort": 0
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.33205.214
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightTicketApi-FinalProject", "FlightTicketApi-FinalProject\FlightTicketApi-FinalProject.csproj", "{14D81370-25AA-42ED-957E-54957081E01C}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {14D81370-25AA-42ED-957E-54957081E01C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {14D81370-25AA-42ED-957E-54957081E01C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {14D81370-25AA-42ED-957E-54957081E01C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {14D81370-25AA-42ED-957E-54957081E01C}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {B2F586E8-7BDA-492E-A60A-1A0C6D8D3F34}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Business/FlightService.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.DataRepository;
2 | using FlightTicketApi_FinalProject.Entities.Abstracts;
3 | using FlightTicketApi_FinalProject.Entities.Concretes;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 |
7 | namespace FlightTicketApi_FinalProject.Business
8 | {
9 | public static class FlightService
10 | {
11 | ///
12 | /// Adds a flight to the repository.
13 | ///
14 | /// The flight to add to the repository.
15 | /// The added flight.
16 | public static Flight AddFlightToRepository(Flight flight)
17 | {
18 | FlightsRepo.Flights.Add(flight);
19 | return flight;
20 | }
21 |
22 | ///
23 | /// Gets a list of available seats for a flight.
24 | ///
25 | /// The flight number to get available seats for.
26 | /// A list of available seats for the flight.
27 | public static List GetAvailableSeats(string flightNumber)
28 | {
29 | Flight flight = FlightsRepo.Flights.FirstOrDefault(f => f.FlightNumber.Equals(flightNumber));
30 | return SeatService.GetAvailableSeatsInFlight(flight);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": ".NET Core Launch (web)",
6 | "type": "coreclr",
7 | "request": "launch",
8 | "preLaunchTask": "build",
9 | "program": "${workspaceFolder}/FlightTicketApi-FinalProject/bin/Debug/net6.0/FlightTicketApi-FinalProject.dll",
10 | "args": [],
11 | "cwd": "${workspaceFolder}/FlightTicketApi-FinalProject",
12 | "stopAtEntry": false,
13 | "serverReadyAction": {
14 | "action": "openExternally",
15 | "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
16 | },
17 | "env": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | },
20 | "sourceFileMap": {
21 | "/Views": "${workspaceFolder}/Views"
22 | }
23 | },
24 | {
25 | "name": ".NET Core Attach",
26 | "type": "coreclr",
27 | "request": "attach"
28 | },
29 | {
30 | "name": "Docker .NET Core Launch",
31 | "type": "docker",
32 | "request": "launch",
33 | "preLaunchTask": "docker-run: debug",
34 | "netCore": {
35 | "appProject": "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
36 | }
37 | }
38 | ]
39 | }
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Business/TicketService.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.DataRepository;
2 | using FlightTicketApi_FinalProject.Entities.Abstracts;
3 | using FlightTicketApi_FinalProject.Entities.Concretes;
4 |
5 | namespace FlightTicketApi_FinalProject.Business
6 | {
7 | public static class TicketService
8 | {
9 | ///
10 | /// Creates a ticket to buy a seat on a flight.
11 | ///
12 | /// The flight to buy a seat on.
13 | /// The selected seat to buy.
14 | /// The created ticket.
15 | public static Ticket CreateTicketToBuySeat(Flight flight, ISeat selectedSeat)
16 | {
17 | selectedSeat.IsAvailable = false;
18 | double price = selectedSeat.Price;
19 | Ticket ticket = new Ticket(flight, selectedSeat, price);
20 | TicketsRepo.Tickets.Add(ticket);
21 | return ticket;
22 | }
23 |
24 | ///
25 | /// Returns a ticket and makes the seat available again.
26 | ///
27 | /// The ticket to return.
28 | public static void ReturnTicket(Ticket ticket)
29 | {
30 | ISeat seat = ticket.SelectedSeat;
31 | seat.IsAvailable = true;
32 | TicketsRepo.Tickets.Remove(ticket);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Builder;
2 | using Microsoft.AspNetCore.Hosting;
3 | using Microsoft.Extensions.Configuration;
4 | using Microsoft.Extensions.DependencyInjection;
5 | using Microsoft.Extensions.Hosting;
6 |
7 | namespace FlightTicketApi_FinalProject
8 | {
9 | public class Startup
10 | {
11 | public Startup(IConfiguration configuration)
12 | {
13 | Configuration = configuration;
14 | }
15 |
16 | public IConfiguration Configuration { get; }
17 |
18 | // This method gets called by the runtime. Use this method to add services to the container.
19 | public void ConfigureServices(IServiceCollection services)
20 | {
21 | services.AddControllers();
22 | services.AddSwaggerDocument(config =>
23 | {
24 | config.PostProcess = (doc =>
25 | {
26 | doc.Info.Title = "Flight Ticket Web API";
27 | doc.Info.Contact = new NSwag.OpenApiContact()
28 | {
29 | Name = "R. Cem Kahveci",
30 | Url = "https://www.github.com/khvci",
31 | };
32 | });
33 | });
34 | }
35 |
36 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
37 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
38 | {
39 | if (env.IsDevelopment())
40 | {
41 | app.UseDeveloperExceptionPage();
42 | }
43 |
44 | app.UseRouting();
45 | app.UseOpenApi();
46 | app.UseSwaggerUi3();
47 |
48 | app.UseAuthorization();
49 |
50 | app.UseEndpoints(endpoints =>
51 | {
52 | endpoints.MapControllers();
53 | });
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Business/SeatService.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.DataRepository;
2 | using FlightTicketApi_FinalProject.Entities.Abstracts;
3 | using FlightTicketApi_FinalProject.Entities.Concretes;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 |
7 | namespace FlightTicketApi_FinalProject.Business
8 | {
9 | public class SeatService
10 | {
11 | ///
12 | /// Creates a list of seats for a flight.
13 | ///
14 | /// The type of plane.
15 | /// The number of rows in business class.
16 | /// An array of plane configurations.
17 | /// An array of column characters.
18 | /// A list of seats for the flight.
19 | public static List CreateSeatsInFlight(int planeType, int businessClassRows, PlaneConfiguration[] configurations, ColumnCharacters[] columnCharacters)
20 | {
21 | int _planeCapacity = (int)configurations[planeType];
22 | int _maxSeatsInBusinessRows = 4;
23 | int _maxSeatsInRegularRows = 6;
24 |
25 | List Seats = new List();
26 |
27 | for (int i = 1; i <= businessClassRows; i++)
28 | {
29 | for (int j = 0; j < _maxSeatsInBusinessRows; j++)
30 | {
31 | ISeat businessSeat = new BusinessSeat(i, columnCharacters[j].ToString());
32 | Seats.Add(businessSeat);
33 | }
34 | }
35 |
36 | for (int i = ++businessClassRows; i <= _planeCapacity; i++)
37 | {
38 | for (int j = 0; j < _maxSeatsInRegularRows; j++)
39 | {
40 | ISeat regularSeat = new RegularSeat(i, columnCharacters[j].ToString());
41 | Seats.Add(regularSeat);
42 | }
43 | }
44 |
45 | return Seats;
46 | }
47 |
48 | ///
49 | /// Gets a list of available seats for a flight.
50 | ///
51 | /// The flight to get available seats for.
52 | /// A list of available seats for the flight.
53 | public static List GetAvailableSeatsInFlight(Flight flight)
54 | {
55 | List availableSeats = flight.Seats.Where(s => s.IsAvailable).ToList();
56 |
57 | return availableSeats;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Entities/Concretes/Flight.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Business;
2 | using FlightTicketApi_FinalProject.Controllers;
3 | using FlightTicketApi_FinalProject.Entities.Abstracts;
4 | using Newtonsoft.Json;
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace FlightTicketApi_FinalProject.Entities.Concretes
9 | {
10 | public class Flight
11 | {
12 | public string FlightNumber { get; set; }
13 | public string PlaneName { get; set; }
14 | public string DepartureCity { get; set; }
15 | public string ArrivalCity { get; set; }
16 | public DateTime FlightTime { get; set; }
17 | public int BusinessClassRows { get; set; }
18 | public List Seats { get; set; }
19 | public int PlaneType { get; set; }
20 | public int DepartureCityId { get; set; }
21 | public int ArrivalCityId { get; set; }
22 | [JsonIgnore]
23 | PlaneConfiguration[] configurations;
24 | [JsonIgnore]
25 | Destination[] destinations;
26 | [JsonIgnore]
27 | ColumnCharacters[] columnCharacters;
28 |
29 | public Flight()
30 | {
31 | }
32 |
33 | public Flight(string flightNumber, int planeType, int departureCityId, int arrivalCityId, DateTime flightTime, int businessClassRows)
34 | {
35 |
36 | configurations = (PlaneConfiguration[])Enum.GetValues(typeof(PlaneConfiguration));
37 | destinations = (Destination[])Enum.GetValues(typeof(Destination));
38 | columnCharacters = (ColumnCharacters[])Enum.GetValues(typeof(ColumnCharacters));
39 |
40 | FlightNumber = flightNumber;
41 | PlaneType = planeType;
42 | PlaneName = configurations[planeType].ToString();
43 | DepartureCityId = departureCityId;
44 | DepartureCity = destinations[departureCityId].ToString();
45 | ArrivalCityId = arrivalCityId;
46 | ArrivalCity = destinations[arrivalCityId].ToString();
47 | FlightTime = flightTime;
48 | BusinessClassRows = businessClassRows;
49 |
50 | Seats = SeatService.CreateSeatsInFlight(planeType, businessClassRows, configurations, columnCharacters);
51 | }
52 |
53 | public Flight(FlightRequestDTO flightRequest) : this(
54 | flightRequest.FlightNumber, flightRequest.PlaneType,
55 | flightRequest.DepartureCityId, flightRequest.ArrivalCityId,
56 | flightRequest.FlightTime, flightRequest.BusinessClassRows)
57 | {
58 | }
59 | }
60 |
61 | ///
62 | /// Represents the destinations for a flight.
63 | ///
64 | public enum Destination
65 | {
66 | Istanbul, London, Berlin, Madrid, Moscow, Dubai, Washington
67 | }
68 |
69 | ///
70 | /// Represents the maximum seat rows for different plane configurations.
71 | ///
72 | public enum PlaneConfiguration
73 | {
74 | // maximum seat rows (6 seats on each row) of planes
75 | AirbusA310 = 27,
76 | AirbusA320 = 30,
77 | Boeing737 = 32,
78 | Boeing747 = 36
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "--project",
36 | "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
37 | ],
38 | "problemMatcher": "$msCompile"
39 | },
40 | {
41 | "type": "docker-build",
42 | "label": "docker-build: debug",
43 | "dependsOn": [
44 | "build"
45 | ],
46 | "dockerBuild": {
47 | "tag": "flightticketapifinalproject:dev",
48 | "target": "base",
49 | "dockerfile": "${workspaceFolder}/FlightTicketApi-FinalProject/Dockerfile",
50 | "context": "${workspaceFolder}",
51 | "pull": true
52 | },
53 | "netCore": {
54 | "appProject": "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
55 | }
56 | },
57 | {
58 | "type": "docker-build",
59 | "label": "docker-build: release",
60 | "dependsOn": [
61 | "build"
62 | ],
63 | "dockerBuild": {
64 | "tag": "flightticketapifinalproject:latest",
65 | "dockerfile": "${workspaceFolder}/FlightTicketApi-FinalProject/Dockerfile",
66 | "context": "${workspaceFolder}",
67 | "pull": true
68 | },
69 | "netCore": {
70 | "appProject": "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
71 | }
72 | },
73 | {
74 | "type": "docker-run",
75 | "label": "docker-run: debug",
76 | "dependsOn": [
77 | "docker-build: debug"
78 | ],
79 | "dockerRun": {},
80 | "netCore": {
81 | "appProject": "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj",
82 | "enableDebugging": true
83 | }
84 | },
85 | {
86 | "type": "docker-run",
87 | "label": "docker-run: release",
88 | "dependsOn": [
89 | "docker-build: release"
90 | ],
91 | "dockerRun": {},
92 | "netCore": {
93 | "appProject": "${workspaceFolder}/FlightTicketApi-FinalProject/FlightTicketApi-FinalProject.csproj"
94 | }
95 | }
96 | ]
97 | }
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Controllers/TicketController.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Business;
2 | using FlightTicketApi_FinalProject.DataRepository;
3 | using FlightTicketApi_FinalProject.Entities.Abstracts;
4 | using FlightTicketApi_FinalProject.Entities.Concretes;
5 | using Microsoft.AspNetCore.Mvc;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 |
10 | namespace FlightTicketApi_FinalProject.Controllers
11 | {
12 | [ApiController]
13 | [Route("api/[controller]")]
14 | public class TicketController : ControllerBase
15 | {
16 | ///
17 | /// Buys a ticket for a given seat selection.
18 | ///
19 | /// The seat selection data transfer object.
20 | /// An ActionResult of type Ticket.
21 | [HttpPost]
22 | [Route("buy")]
23 | public ActionResult BuyTicket([FromBody] SeatSelectionDTO seatSelection)
24 | {
25 | try
26 | {
27 | Flight flight = FlightsRepo.Flights.FirstOrDefault(f => f.FlightNumber.Equals(seatSelection.FlightNumber));
28 |
29 | if (flight == null)
30 | {
31 | return BadRequest("Flight not found");
32 | }
33 |
34 | ISeat selectedSeat;
35 | string seatType = seatSelection.SeatRow <= flight.BusinessClassRows ? "BusinessSeat" : "RegularSeat";
36 | selectedSeat = flight.Seats.FirstOrDefault(
37 | s => s.SeatRow == seatSelection.SeatRow && s.SeatColumn == seatSelection.SeatColumn && s.GetType().Name == seatType && s.IsAvailable);
38 |
39 | if (selectedSeat == null)
40 | {
41 | return BadRequest($"Seat {seatSelection.SeatRow}{seatSelection.SeatColumn} is not available.");
42 | }
43 |
44 | Ticket ticket = TicketService.CreateTicketToBuySeat(flight, selectedSeat);
45 | return Ok(ticket);
46 | }
47 | catch (Exception ex)
48 | {
49 | return StatusCode(500, "Internal server error");
50 | }
51 |
52 | }
53 |
54 | ///
55 | /// Returns a ticket.
56 | ///
57 | /// The ticket return request data transfer object.
58 | /// An ActionResult of type string.
59 | [HttpDelete]
60 | [Route("return")]
61 | public ActionResult ReturnTicket([FromBody] TicketReturnRequestDTO request)
62 | {
63 | try
64 | {
65 | if (TicketsRepo.Tickets == null)
66 | {
67 | return BadRequest("Tickets repository is not initialized");
68 | }
69 |
70 | Ticket ticket = TicketsRepo.Tickets.FirstOrDefault(t => t.TicketToken.Equals(request.TicketToken));
71 |
72 | if (ticket == null)
73 | {
74 | return BadRequest("Ticket not found");
75 | }
76 |
77 | TicketService.ReturnTicket(ticket);
78 | return Ok("Ticket returned successfully");
79 | }
80 | catch (Exception ex)
81 | {
82 | return StatusCode(500, "Internal server error");
83 | }
84 | }
85 |
86 | ///
87 | /// Gets all tickets from the repository.
88 | ///
89 | /// An ActionResult of type List of Ticket.
90 | [HttpGet]
91 | [Route("all")]
92 | public ActionResult> GetAllTickets()
93 | {
94 | try
95 | {
96 | if (TicketsRepo.Tickets == null)
97 | {
98 | return BadRequest("Tickets repository is not initialized");
99 | }
100 | return Ok(TicketsRepo.Tickets);
101 | }
102 | catch (Exception ex)
103 | {
104 | return StatusCode(500, "Internal server error");
105 | }
106 | }
107 | }
108 |
109 | ///
110 | /// A data transfer object representing a seat selection.
111 | ///
112 | public class SeatSelectionDTO
113 | {
114 | public string FlightNumber { get; set; }
115 | public int SeatRow { get; set; }
116 | public string SeatColumn { get; set; }
117 | }
118 |
119 | ///
120 | /// A data transfer object representing a ticket return request.
121 | ///
122 | public class TicketReturnRequestDTO
123 | {
124 | public string TicketToken { get; set; }
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/FlightTicketApi-FinalProject/Controllers/FlightController.cs:
--------------------------------------------------------------------------------
1 | using FlightTicketApi_FinalProject.Business;
2 | using FlightTicketApi_FinalProject.DataRepository;
3 | using FlightTicketApi_FinalProject.Entities.Abstracts;
4 | using FlightTicketApi_FinalProject.Entities.Concretes;
5 | using Microsoft.AspNetCore.Mvc;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 |
10 | namespace FlightTicketApi_FinalProject.Controllers
11 | {
12 | [Route("api/[controller]")]
13 | public class FlightController : ControllerBase
14 | {
15 | ///
16 | /// Creates a new flight and adds it to the repository.
17 | ///
18 | /// The flight request data transfer object.
19 | /// An ActionResult of type Flight.
20 | [HttpPost]
21 | public ActionResult CreateFlight([FromBody] FlightRequestDTO flightRequest)
22 | {
23 | try
24 | {
25 | if (FlightsRepo.Flights.Exists(f => f.FlightNumber == flightRequest.FlightNumber))
26 | {
27 | return BadRequest($"Flight with flight number {flightRequest.FlightNumber} already exists.");
28 | }
29 |
30 | Flight flight = new Flight(flightRequest);
31 | FlightService.AddFlightToRepository(flight);
32 |
33 | return Ok(flight);
34 | }
35 | catch (Exception ex)
36 | {
37 | return StatusCode(500, "Internal server error");
38 | }
39 | }
40 |
41 | ///
42 | /// Gets the available seats for a given flight number.
43 | ///
44 | /// The flight number.
45 | /// An ActionResult of type List of ISeat.
46 | [HttpGet]
47 | [Route("{flightNumber}")]
48 | public ActionResult> GetAvailableSeats(string flightNumber)
49 | {
50 | try
51 | {
52 | Flight flight = FlightsRepo.Flights.FirstOrDefault(f => f.FlightNumber.Equals(flightNumber));
53 | if (flight == null)
54 | {
55 | return BadRequest("Flight not found");
56 | }
57 |
58 | return Ok(SeatService.GetAvailableSeatsInFlight(flight));
59 | }
60 | catch (Exception ex)
61 | {
62 | return StatusCode(500, "Internal server error");
63 | }
64 | }
65 |
66 | ///
67 | /// Gets all flights from the repository.
68 | ///
69 | /// An ActionResult of type List of FlightResponseDTO.
70 | [HttpGet]
71 | [Route("all")]
72 | public ActionResult> GetAllFlights()
73 | {
74 | try
75 | {
76 | if (FlightsRepo.Flights == null)
77 | {
78 | return BadRequest("Flights repository is not initialized");
79 | }
80 |
81 | List allFlightDTO = FlightsRepo.Flights
82 | .Select(f => new FlightResponseDTO(f)).ToList();
83 |
84 | return Ok(allFlightDTO);
85 | }
86 | catch (Exception ex)
87 | {
88 | return StatusCode(500, "Internal server error");
89 | }
90 | }
91 |
92 | ///
93 | /// Deletes a flight from the repository.
94 | ///
95 | /// The flight number.
96 | /// An ActionResult of type string.
97 | [HttpDelete]
98 | [Route("delete/{flightNumber}")]
99 | public ActionResult DeleteFlight(string flightNumber)
100 | {
101 | try
102 | {
103 | Flight flight = FlightsRepo.Flights.FirstOrDefault(f => f.FlightNumber.Equals(flightNumber));
104 | if (flight == null)
105 | {
106 | return BadRequest("Flight not found");
107 | }
108 | FlightsRepo.Flights.Remove(flight);
109 | TicketsRepo.Tickets.RemoveAll(t => t.FlightNumber.Equals(flight.FlightNumber));
110 | return Ok($"Flight {flightNumber} has been deleted");
111 |
112 | }
113 | catch (Exception ex)
114 | {
115 | return StatusCode(500, "Internal server error");
116 | }
117 | }
118 | }
119 |
120 | ///
121 | /// A data transfer object representing a flight request.
122 | ///
123 | public class FlightRequestDTO
124 | {
125 | public string FlightNumber { get; set; }
126 | public int PlaneType { get; set; }
127 | public int DepartureCityId { get; set; }
128 | public int ArrivalCityId { get; set; }
129 | public DateTime FlightTime { get; set; }
130 | public int BusinessClassRows { get; set; }
131 | }
132 |
133 | ///
134 | /// A data transfer object representing a flight response.
135 | ///
136 | public class FlightResponseDTO
137 | {
138 | public string FlightNumber { get; set; }
139 | public string PlaneName { get; set; }
140 | public string DepartureCity { get; set; }
141 | public string ArrivalCity { get; set; }
142 | public DateTime FlightTime { get; set; }
143 | public int BusinessClassRows { get; set; }
144 |
145 | public FlightResponseDTO()
146 | {
147 | }
148 |
149 | public FlightResponseDTO(string flightNumber, string planeName, string departureCity, string arrivalCity, DateTime flightTime, int businessClassRows)
150 | {
151 | this.FlightNumber = flightNumber;
152 | this.PlaneName = planeName;
153 | this.DepartureCity = departureCity;
154 | this.ArrivalCity = arrivalCity;
155 | this.FlightTime = flightTime;
156 | this.BusinessClassRows = businessClassRows;
157 | }
158 |
159 | public FlightResponseDTO(Flight flight) :
160 | this(flight.FlightNumber, flight.PlaneName, flight.DepartureCity, flight.ArrivalCity, flight.FlightTime, flight.BusinessClassRows)
161 | {
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------