-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
768 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
namespace BotwinMediator | ||
{ | ||
using System.IO; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
|
||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var host = new WebHostBuilder() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.UseKestrel() | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>() | ||
.Build(); | ||
|
||
host.Run(); | ||
.Build() | ||
.Run(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
FunctionalProject/Features/FuncFilms/CreateFilm/CreateFilmRoute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace FunctionalProject.Features.FuncFilms.CreateFilm | ||
{ | ||
using System; | ||
using Models; | ||
|
||
public static class CreateFilmRoute | ||
{ | ||
public static void Handle(Film film, Func<bool> validUserQuery) | ||
{ | ||
if (!validUserQuery()) | ||
{ | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
//Do some special MEGA CORP business validation | ||
|
||
//Save to database by writing SQL here | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
FunctionalProject/Features/FuncFilms/DeleteFilm/DeleteFilmRoute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace FunctionalProject.Features.FuncFilms.DeleteFilm | ||
{ | ||
using System; | ||
|
||
public static class DeleteFilmRoute | ||
{ | ||
public static void Handle(int id, Func<bool> validUserQuery) | ||
{ | ||
if (!validUserQuery()) | ||
{ | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
//Write some SQL to delete from DB | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...DelegateFilms/ListFilms/ListFilmsRoute.cs → ...res/FuncFilms/ListFilms/ListFilmsRoute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...legateFilms/UpdateFilm/UpdateFilmRoute.cs → ...s/FuncFilms/UpdateFilm/UpdateFilmRoute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
FunctionalProject/Features/NamedDelegatesFilms/CastMembers/GetCastByFilmIdQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace FunctionalProject.Features.NamedDelegatesFilms.CastMembers | ||
{ | ||
using System.Collections.Generic; | ||
using Models; | ||
|
||
public static class GetCastByFilmIdQuery | ||
{ | ||
public static IEnumerable<CastMember> Execute(int filmId) | ||
{ | ||
//Do some SQL | ||
|
||
return new[] { new CastMember { Name = "John Travolta" }, new CastMember { Name = "Samuel L Jackson" } }; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
FunctionalProject/Features/NamedDelegatesFilms/Directors/GetDirectorByIdQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace FunctionalProject.Features.NamedDelegatesFilms.Directors | ||
{ | ||
using Models; | ||
|
||
public static class GetDirectorByIdQuery | ||
{ | ||
public static Director Execute(int id) | ||
{ | ||
//Do some SQL | ||
|
||
return new Director { Name = "Steven Spielberg" }; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
FunctionalProject/Features/NamedDelegatesFilms/Films/CreateFilm/CreateFilmRoute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace FunctionalProject.Features.NamedDelegatesFilms.Films.CreateFilm | ||
{ | ||
using System; | ||
using Models; | ||
|
||
public static class CreateFilmRoute | ||
{ | ||
public static void Handle(Film film, ValidUserDelegate validUserQuery) | ||
{ | ||
if (!validUserQuery()) | ||
{ | ||
throw new InvalidOperationException(); | ||
} | ||
|
||
//Do some special MEGA CORP business validation | ||
|
||
//Save to database by writing SQL here | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
FunctionalProject/Features/NamedDelegatesFilms/Films/Delegates.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace FunctionalProject.Features.NamedDelegatesFilms.Films | ||
{ | ||
using System.Collections.Generic; | ||
using Models; | ||
|
||
public delegate Film ListFilmByIdDelegate(int id); | ||
|
||
public delegate void CreateFilmDelegate(Film film); | ||
|
||
public delegate void DeleteFilmDelegate(int id); | ||
|
||
public delegate IEnumerable<Film> ListFilmsDelegate(); | ||
|
||
public delegate void UpdateFilmDelegate(int id, Film film); | ||
|
||
public delegate bool ValidUserDelegate(); | ||
|
||
public delegate Director GetDirectorByIdDelegate(int id); | ||
|
||
public delegate IEnumerable<CastMember> GetCastByFilmIdDelegate(int filmId); | ||
} |
Oops, something went wrong.