├── .gitignore
├── Async-Repo-Start
├── .gitignore
├── AccountOwnerServer.sln
├── AccountOwnerServer
│ ├── AccountOwnerServer.csproj
│ ├── AccountOwnerServer.csproj.user
│ ├── Controllers
│ │ ├── OwnerController.cs
│ │ └── WeatherForecastController.cs
│ ├── Extensions
│ │ └── ServiceExtensions.cs
│ ├── MappingProfile.cs
│ ├── Program.cs
│ ├── Properties
│ │ ├── PublishProfiles
│ │ │ ├── FolderProfile.pubxml
│ │ │ └── FolderProfile.pubxml.user
│ │ └── launchSettings.json
│ ├── Startup.cs
│ ├── WeatherForecast.cs
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ └── nlog.config
├── Contracts
│ ├── Contracts.csproj
│ ├── IAccountRepository.cs
│ ├── ILoggerManager.cs
│ ├── IOwnerRepository.cs
│ ├── IRepositoryBase.cs
│ └── IRepositoryWrapper.cs
├── Entities
│ ├── DataTransferObjects
│ │ ├── AccountDto.cs
│ │ ├── OwnerDto.cs
│ │ ├── OwnerForCreationDto.cs
│ │ └── OwnerForUpdateDto.cs
│ ├── Entities.csproj
│ ├── Enumerations
│ │ └── AccountType.cs
│ ├── ExtendedModels
│ │ └── OwnerExtended.cs
│ ├── Extensions
│ │ ├── IEntityExtensions.cs
│ │ └── OwnerExtensions.cs
│ ├── IEntity.cs
│ ├── Models
│ │ ├── Account.cs
│ │ └── Owner.cs
│ └── RepositoryContext.cs
├── LoggerService
│ ├── LoggerManager.cs
│ └── LoggerService.csproj
├── README.md
├── Repository
│ ├── AccountRepository.cs
│ ├── OwnerRepository.cs
│ ├── Repository.csproj
│ ├── RepositoryBase.cs
│ └── RepositoryWrapper.cs
└── _MySQL_Init_Script
│ └── init.sql
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /Async-Repo-Start/.vs
2 |
--------------------------------------------------------------------------------
/Async-Repo-Start/.gitignore:
--------------------------------------------------------------------------------
1 | /AccountOwnerServer/obj
2 | /AccountOwnerServer/bin
3 | /Contracts/obj
4 | /Contracts/bin
5 | /Entities/obj
6 | /Entities/bin
7 | /LoggerService/obj
8 | /LoggerService/bin
9 | /Repository/obj
10 | /Repository/bin
11 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29424.173
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountOwnerServer", "AccountOwnerServer\AccountOwnerServer.csproj", "{D9142A6E-9687-4BA4-9CF9-A9AFF006E3DF}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contracts", "Contracts\Contracts.csproj", "{E75B1842-10BD-4BF3-A96A-830220E57332}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoggerService", "LoggerService\LoggerService.csproj", "{DA66E4D3-1CDD-407D-9900-FC27F5AF8F06}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entities", "Entities\Entities.csproj", "{3466888D-D523-4180-B3E4-69953F45F520}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Repository", "Repository\Repository.csproj", "{7EB45A88-65DE-4A64-852A-3B6921B32D2E}"
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Any CPU = Debug|Any CPU
19 | Release|Any CPU = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {D9142A6E-9687-4BA4-9CF9-A9AFF006E3DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {D9142A6E-9687-4BA4-9CF9-A9AFF006E3DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {D9142A6E-9687-4BA4-9CF9-A9AFF006E3DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {D9142A6E-9687-4BA4-9CF9-A9AFF006E3DF}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {E75B1842-10BD-4BF3-A96A-830220E57332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {E75B1842-10BD-4BF3-A96A-830220E57332}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {E75B1842-10BD-4BF3-A96A-830220E57332}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {E75B1842-10BD-4BF3-A96A-830220E57332}.Release|Any CPU.Build.0 = Release|Any CPU
30 | {DA66E4D3-1CDD-407D-9900-FC27F5AF8F06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {DA66E4D3-1CDD-407D-9900-FC27F5AF8F06}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {DA66E4D3-1CDD-407D-9900-FC27F5AF8F06}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {DA66E4D3-1CDD-407D-9900-FC27F5AF8F06}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {3466888D-D523-4180-B3E4-69953F45F520}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35 | {3466888D-D523-4180-B3E4-69953F45F520}.Debug|Any CPU.Build.0 = Debug|Any CPU
36 | {3466888D-D523-4180-B3E4-69953F45F520}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {3466888D-D523-4180-B3E4-69953F45F520}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {7EB45A88-65DE-4A64-852A-3B6921B32D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39 | {7EB45A88-65DE-4A64-852A-3B6921B32D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
40 | {7EB45A88-65DE-4A64-852A-3B6921B32D2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
41 | {7EB45A88-65DE-4A64-852A-3B6921B32D2E}.Release|Any CPU.Build.0 = Release|Any CPU
42 | EndGlobalSection
43 | GlobalSection(SolutionProperties) = preSolution
44 | HideSolutionNode = FALSE
45 | EndGlobalSection
46 | GlobalSection(ExtensibilityGlobals) = postSolution
47 | SolutionGuid = {12A94BCC-D511-439A-9D3B-C1253CB1C879}
48 | EndGlobalSection
49 | EndGlobal
50 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/AccountOwnerServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 | all
12 | runtime; build; native; contentfiles; analyzers; buildtransitive
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/AccountOwnerServer.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ProjectDebugger
5 |
6 |
7 | AccountOwnerServer
8 | ApiControllerEmptyScaffolder
9 | root/Controller
10 | 600
11 | True
12 | False
13 | True
14 |
15 | False
16 | FolderProfile
17 |
18 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Controllers/OwnerController.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using Contracts;
3 | using Entities.DataTransferObjects;
4 | using Entities.Models;
5 | using Microsoft.AspNetCore.Mvc;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 |
10 | namespace AccountOwnerServer.Controllers
11 | {
12 | [Route("api/owner")]
13 | [ApiController]
14 | public class OwnerController : ControllerBase
15 | {
16 | private ILoggerManager _logger;
17 | private IRepositoryWrapper _repository;
18 | private IMapper _mapper;
19 |
20 | public OwnerController(ILoggerManager logger, IRepositoryWrapper repository, IMapper mapper)
21 | {
22 | _logger = logger;
23 | _repository = repository;
24 | _mapper = mapper;
25 | }
26 |
27 | [HttpGet]
28 | public IActionResult GetAllOwners()
29 | {
30 | try
31 | {
32 | var owners = _repository.Owner.GetAllOwners();
33 | _logger.LogInfo($"Returned all owners from database.");
34 |
35 | var ownersResult = _mapper.Map>(owners);
36 | return Ok(ownersResult);
37 | }
38 | catch (Exception ex)
39 | {
40 | _logger.LogError($"Something went wrong inside GetAllOwners action: {ex.Message}");
41 | return StatusCode(500, "Internal server error");
42 | }
43 | }
44 |
45 | [HttpGet("{id}", Name = "OwnerById")]
46 | public IActionResult GetOwnerById(Guid id)
47 | {
48 | try
49 | {
50 | var owner = _repository.Owner.GetOwnerById(id);
51 | if (owner == null)
52 | {
53 | _logger.LogError($"Owner with id: {id}, hasn't been found in db.");
54 | return NotFound();
55 | }
56 | else
57 | {
58 | _logger.LogInfo($"Returned owner with id: {id}");
59 |
60 | var ownerResult = _mapper.Map(owner);
61 | return Ok(ownerResult);
62 | }
63 | }
64 | catch (Exception ex)
65 | {
66 | _logger.LogError($"Something went wrong inside GetOwnerById action: {ex.Message}");
67 | return StatusCode(500, "Internal server error");
68 | }
69 | }
70 |
71 | [HttpGet("{id}/account")]
72 | public IActionResult GetOwnerWithDetails(Guid id)
73 | {
74 | try
75 | {
76 | var owner = _repository.Owner.GetOwnerWithDetails(id);
77 | if (owner == null)
78 | {
79 | _logger.LogError($"Owner with id: {id}, hasn't been found in db.");
80 | return NotFound();
81 | }
82 | else
83 | {
84 | _logger.LogInfo($"Returned owner with details for id: {id}");
85 |
86 | var ownerResult = _mapper.Map(owner);
87 | return Ok(ownerResult);
88 | }
89 | }
90 | catch (Exception ex)
91 | {
92 | _logger.LogError($"Something went wrong inside GetOwnerWithDetails action: {ex.Message}");
93 | return StatusCode(500, "Internal server error");
94 | }
95 | }
96 |
97 | [HttpPost]
98 | public IActionResult CreateOwner([FromBody]OwnerForCreationDto owner)
99 | {
100 | try
101 | {
102 | if (owner == null)
103 | {
104 | _logger.LogError("Owner object sent from client is null.");
105 | return BadRequest("Owner object is null");
106 | }
107 |
108 | if (!ModelState.IsValid)
109 | {
110 | _logger.LogError("Invalid owner object sent from client.");
111 | return BadRequest("Invalid model object");
112 | }
113 |
114 | var ownerEntity = _mapper.Map(owner);
115 |
116 | _repository.Owner.CreateOwner(ownerEntity);
117 | _repository.Save();
118 |
119 | var createdOwner = _mapper.Map(ownerEntity);
120 |
121 | return CreatedAtRoute("OwnerById", new { id = createdOwner.Id }, createdOwner);
122 | }
123 | catch (Exception ex)
124 | {
125 | _logger.LogError($"Something went wrong inside CreateOwner action: {ex.Message}");
126 | return StatusCode(500, "Internal server error");
127 | }
128 | }
129 |
130 | [HttpPut("{id}")]
131 | public IActionResult UpdateOwner(Guid id, [FromBody]OwnerForUpdateDto owner)
132 | {
133 | try
134 | {
135 | if (owner == null)
136 | {
137 | _logger.LogError("Owner object sent from client is null.");
138 | return BadRequest("Owner object is null");
139 | }
140 |
141 | if (!ModelState.IsValid)
142 | {
143 | _logger.LogError("Invalid owner object sent from client.");
144 | return BadRequest("Invalid model object");
145 | }
146 |
147 | var ownerEntity = _repository.Owner.GetOwnerById(id);
148 | if (ownerEntity == null)
149 | {
150 | _logger.LogError($"Owner with id: {id}, hasn't been found in db.");
151 | return NotFound();
152 | }
153 |
154 | _mapper.Map(owner, ownerEntity);
155 |
156 | _repository.Owner.UpdateOwner(ownerEntity);
157 | _repository.Save();
158 |
159 | return NoContent();
160 | }
161 | catch (Exception ex)
162 | {
163 | _logger.LogError($"Something went wrong inside UpdateOwner action: {ex.Message}");
164 | return StatusCode(500, "Internal server error");
165 | }
166 | }
167 |
168 | [HttpDelete("{id}")]
169 | public IActionResult DeleteOwner(Guid id)
170 | {
171 | try
172 | {
173 | var owner = _repository.Owner.GetOwnerById(id);
174 | if (owner == null)
175 | {
176 | _logger.LogError($"Owner with id: {id}, hasn't been found in db.");
177 | return NotFound();
178 | }
179 |
180 | if (_repository.Account.AccountsByOwner(id).Any())
181 | {
182 | _logger.LogError($"Cannot delete owner with id: {id}. It has related accounts. Delete those accounts first");
183 | return BadRequest("Cannot delete owner. It has related accounts. Delete those accounts first");
184 | }
185 |
186 | _repository.Owner.DeleteOwner(owner);
187 | _repository.Save();
188 |
189 | return NoContent();
190 | }
191 | catch (Exception ex)
192 | {
193 | _logger.LogError($"Something went wrong inside DeleteOwner action: {ex.Message}");
194 | return StatusCode(500, "Internal server error");
195 | }
196 | }
197 | }
198 | }
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Contracts;
6 | using Microsoft.AspNetCore.Mvc;
7 | using Microsoft.Extensions.Logging;
8 |
9 | namespace WebApplication1.Controllers
10 | {
11 | [ApiController]
12 | [Route("[controller]")]
13 | public class WeatherForecastController : ControllerBase
14 | {
15 | private IRepositoryWrapper _repository;
16 |
17 | public WeatherForecastController(IRepositoryWrapper repository)
18 | {
19 | _repository = repository;
20 | }
21 |
22 | [HttpGet]
23 | public IEnumerable Get()
24 | {
25 | var domesticAccounts = _repository.Account.FindByCondition(x => x.AccountType.Equals("Domestic"));
26 | var owners = _repository.Owner.FindAll();
27 |
28 | return new string[] { "value1", "value2" };
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Extensions/ServiceExtensions.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using Entities;
3 | using LoggerService;
4 | using Microsoft.AspNetCore.Builder;
5 | using Microsoft.EntityFrameworkCore;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.DependencyInjection;
8 | using Repository;
9 |
10 | namespace AccountOwnerServer.Extensions
11 | {
12 | public static class ServiceExtensions
13 | {
14 | public static void ConfigureCors(this IServiceCollection services)
15 | {
16 | services.AddCors(options =>
17 | {
18 | options.AddPolicy("CorsPolicy",
19 | builder => builder.AllowAnyOrigin()
20 | .AllowAnyMethod()
21 | .AllowAnyHeader());
22 | });
23 | }
24 |
25 | public static void ConfigureIISIntegration(this IServiceCollection services)
26 | {
27 | services.Configure(options =>
28 | {
29 |
30 | });
31 | }
32 |
33 | public static void ConfigureLoggerService(this IServiceCollection services)
34 | {
35 | services.AddSingleton();
36 | }
37 |
38 | public static void ConfigureMySqlContext(this IServiceCollection services, IConfiguration config)
39 | {
40 | var connectionString = config["mysqlconnection:connectionString"];
41 | services.AddDbContext(o => o.UseMySql(connectionString));
42 | }
43 |
44 | public static void ConfigureRepositoryWrapper(this IServiceCollection services)
45 | {
46 | services.AddScoped();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/MappingProfile.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using Entities.DataTransferObjects;
3 | using Entities.Models;
4 | using System.Linq;
5 |
6 | namespace AccountOwnerServer
7 | {
8 | public class MappingProfile : Profile
9 | {
10 | public MappingProfile()
11 | {
12 | CreateMap();
13 |
14 | CreateMap();
15 |
16 | CreateMap();
17 |
18 | CreateMap();
19 |
20 | CreateMap();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 |
10 | namespace AccountOwnerServer
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 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Properties/PublishProfiles/FolderProfile.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | FileSystem
10 | Debug
11 | Any CPU
12 |
13 | True
14 | False
15 | d6116708-5d20-43c2-a796-9716ac8885f3
16 | D:\Projects\Blog-AccountOwner\Project\publish
17 | False
18 | netcoreapp2.2
19 | false
20 | <_IsPortable>true
21 |
22 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Properties/PublishProfiles/FolderProfile.pubxml.user:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | <_PublishTargetUrl>D:\Projects\Blog-AccountOwner\Project\publish
10 |
11 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:5000",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "IIS Express": {
13 | "commandName": "IISExpress",
14 | "launchBrowser": false,
15 | "environmentVariables": {
16 | "ASPNETCORE_ENVIRONMENT": "Development"
17 | }
18 | },
19 | "AccountOwnerServer": {
20 | "commandName": "Project",
21 | "launchBrowser": false,
22 | "applicationUrl": "http://localhost:5000",
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/Startup.cs:
--------------------------------------------------------------------------------
1 | using AccountOwnerServer.Extensions;
2 | using AutoMapper;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.AspNetCore.Hosting;
5 | using Microsoft.AspNetCore.HttpOverrides;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.DependencyInjection;
8 | using Microsoft.Extensions.Hosting;
9 | using NLog;
10 | using System.IO;
11 |
12 | namespace AccountOwnerServer
13 | {
14 | public class Startup
15 | {
16 | public Startup(IConfiguration configuration)
17 | {
18 | LogManager.LoadConfiguration(string.Concat(Directory.GetCurrentDirectory(), "/nlog.config"));
19 | Configuration = configuration;
20 | }
21 |
22 | public IConfiguration Configuration { get; }
23 |
24 | public void ConfigureServices(IServiceCollection services)
25 | {
26 | services.ConfigureCors();
27 | services.ConfigureIISIntegration();
28 | services.ConfigureLoggerService();
29 | services.ConfigureMySqlContext(Configuration);
30 | services.ConfigureRepositoryWrapper();
31 | services.AddAutoMapper(typeof(Startup));
32 |
33 | services.AddControllers();
34 | }
35 |
36 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
37 | {
38 | if (env.IsDevelopment())
39 | {
40 | app.UseDeveloperExceptionPage();
41 | }
42 |
43 | app.UseHttpsRedirection();
44 | app.UseStaticFiles();
45 |
46 | app.UseCors("CorsPolicy");
47 |
48 | app.UseForwardedHeaders(new ForwardedHeadersOptions
49 | {
50 | ForwardedHeaders = ForwardedHeaders.All
51 | });
52 |
53 | app.UseRouting();
54 |
55 | app.UseAuthorization();
56 |
57 | app.UseEndpoints(endpoints =>
58 | {
59 | endpoints.MapControllers();
60 | });
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WebApplication1
4 | {
5 | public class WeatherForecast
6 | {
7 | public DateTime Date { get; set; }
8 |
9 | public int TemperatureC { get; set; }
10 |
11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12 |
13 | public string Summary { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "mysqlconnection": {
10 | "connectionString": "server=localhost;userid=root;password=Sh0v3lyJ0e;database=accountowner;"
11 | },
12 | "AllowedHosts": "*"
13 | }
14 |
--------------------------------------------------------------------------------
/Async-Repo-Start/AccountOwnerServer/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/Contracts.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/IAccountRepository.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Contracts
6 | {
7 | public interface IAccountRepository : IRepositoryBase
8 | {
9 | IEnumerable AccountsByOwner(Guid ownerId);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/ILoggerManager.cs:
--------------------------------------------------------------------------------
1 | namespace Contracts
2 | {
3 | public interface ILoggerManager
4 | {
5 | void LogInfo(string message);
6 | void LogWarn(string message);
7 | void LogDebug(string message);
8 | void LogError(string message);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/IOwnerRepository.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Contracts
6 | {
7 | public interface IOwnerRepository
8 | {
9 | IEnumerable GetAllOwners();
10 | Owner GetOwnerById(Guid ownerId);
11 | Owner GetOwnerWithDetails(Guid ownerId);
12 | void CreateOwner(Owner owner);
13 | void UpdateOwner(Owner owner);
14 | void DeleteOwner(Owner owner);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/IRepositoryBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Linq.Expressions;
5 | using System.Text;
6 |
7 | namespace Contracts
8 | {
9 | public interface IRepositoryBase
10 | {
11 | IQueryable FindAll();
12 | IQueryable FindByCondition(Expression> expression);
13 | void Create(T entity);
14 | void Update(T entity);
15 | void Delete(T entity);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Contracts/IRepositoryWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Contracts
6 | {
7 | public interface IRepositoryWrapper
8 | {
9 | IOwnerRepository Owner { get; }
10 | IAccountRepository Account { get; }
11 | void Save();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/DataTransferObjects/AccountDto.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Entities.DataTransferObjects
4 | {
5 | public class AccountDto
6 | {
7 | public Guid Id { get; set; }
8 | public DateTime DateCreated { get; set; }
9 | public string AccountType { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/DataTransferObjects/OwnerDto.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.DataTransferObjects
7 | {
8 | public class OwnerDto
9 | {
10 | public Guid Id { get; set; }
11 | public string Name { get; set; }
12 | public DateTime DateOfBirth { get; set; }
13 | public string Address { get; set; }
14 |
15 | public IEnumerable Accounts { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/DataTransferObjects/OwnerForCreationDto.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace Entities.DataTransferObjects
5 | {
6 | public class OwnerForCreationDto
7 | {
8 | [Required(ErrorMessage = "Name is required")]
9 | [StringLength(60, ErrorMessage = "Name can't be longer than 60 characters")]
10 | public string Name { get; set; }
11 |
12 | [Required(ErrorMessage = "Date of birth is required")]
13 | public DateTime DateOfBirth { get; set; }
14 |
15 | [Required(ErrorMessage = "Address is required")]
16 | [StringLength(100, ErrorMessage = "Address cannot be loner then 100 characters")]
17 | public string Address { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/DataTransferObjects/OwnerForUpdateDto.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace Entities.DataTransferObjects
5 | {
6 | public class OwnerForUpdateDto
7 | {
8 | [Required(ErrorMessage = "Name is required")]
9 | [StringLength(60, ErrorMessage = "Name can't be longer than 60 characters")]
10 | public string Name { get; set; }
11 |
12 | [Required(ErrorMessage = "Date of birth is required")]
13 | public DateTime DateOfBirth { get; set; }
14 |
15 | [Required(ErrorMessage = "Address is required")]
16 | [StringLength(100, ErrorMessage = "Address cannot be loner then 100 characters")]
17 | public string Address { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Entities.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Enumerations/AccountType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Entities.Enumerations
6 | {
7 | public enum AccountType
8 | {
9 | Domestic,
10 | Savings,
11 | Foreign
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/ExtendedModels/OwnerExtended.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.ExtendedModels
7 | {
8 | public class OwnerExtended : IEntity
9 | {
10 | public Guid Id { get; set; }
11 | public string Name { get; set; }
12 | public DateTime DateOfBirth { get; set; }
13 | public string Address { get; set; }
14 |
15 | public IEnumerable Accounts { get; set; }
16 |
17 | public OwnerExtended()
18 | {
19 | }
20 |
21 | public OwnerExtended(Owner owner)
22 | {
23 | Id = owner.Id;
24 | Name = owner.Name;
25 | DateOfBirth = owner.DateOfBirth;
26 | Address = owner.Address;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Extensions/IEntityExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Entities.Extensions
6 | {
7 | public static class IEntityExtensions
8 | {
9 | public static bool IsObjectNull(this IEntity entity)
10 | {
11 | return entity == null;
12 | }
13 |
14 | public static bool IsEmptyObject(this IEntity entity)
15 | {
16 | return entity.Id.Equals(Guid.Empty);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Extensions/OwnerExtensions.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Entities.Extensions
7 | {
8 | public static class OwnerExtensions
9 | {
10 | public static void Map(this Owner dbOwner, Owner owner)
11 | {
12 | dbOwner.Name = owner.Name;
13 | dbOwner.Address = owner.Address;
14 | dbOwner.DateOfBirth = owner.DateOfBirth;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Entities
6 | {
7 | public interface IEntity
8 | {
9 | Guid Id { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Models/Account.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Entities.Models
6 | {
7 | [Table("account")]
8 | public class Account
9 | {
10 | [Column("AccountId")]
11 | public Guid Id { get; set; }
12 |
13 | [Required(ErrorMessage = "Date created is required")]
14 | public DateTime DateCreated { get; set; }
15 |
16 | [Required(ErrorMessage = "Account type is required")]
17 | public string AccountType { get; set; }
18 |
19 | [Required(ErrorMessage = "Owner Id is required")]
20 |
21 | [ForeignKey(nameof(Owner))]
22 | public Guid OwnerId { get; set; }
23 | public Owner Owner { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/Models/Owner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 |
6 | namespace Entities.Models
7 | {
8 | [Table("owner")]
9 | public class Owner
10 | {
11 | [Column("OwnerId")]
12 | public Guid Id { get; set; }
13 |
14 | [Required(ErrorMessage = "Name is required")]
15 | [StringLength(60, ErrorMessage = "Name can't be longer than 60 characters")]
16 | public string Name { get; set; }
17 |
18 | [Required(ErrorMessage = "Date of birth is required")]
19 | public DateTime DateOfBirth { get; set; }
20 |
21 | [Required(ErrorMessage = "Address is required")]
22 | [StringLength(100, ErrorMessage = "Address cannot be loner then 100 characters")]
23 | public string Address { get; set; }
24 |
25 | public ICollection Accounts { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Entities/RepositoryContext.cs:
--------------------------------------------------------------------------------
1 | using Entities.Models;
2 | using Microsoft.EntityFrameworkCore;
3 |
4 | namespace Entities
5 | {
6 | public class RepositoryContext : DbContext
7 | {
8 | public RepositoryContext(DbContextOptions options)
9 | : base(options)
10 | {
11 | }
12 |
13 | public DbSet Owners { get; set; }
14 | public DbSet Accounts { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Async-Repo-Start/LoggerService/LoggerManager.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using NLog;
3 |
4 | namespace LoggerService
5 | {
6 | public class LoggerManager : ILoggerManager
7 | {
8 | private static ILogger logger = LogManager.GetCurrentClassLogger();
9 |
10 | public void LogDebug(string message)
11 | {
12 | logger.Debug(message);
13 | }
14 |
15 | public void LogError(string message)
16 | {
17 | logger.Error(message);
18 | }
19 |
20 | public void LogInfo(string message)
21 | {
22 | logger.Info(message);
23 | }
24 |
25 | public void LogWarn(string message)
26 | {
27 | logger.Warn(message);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Async-Repo-Start/LoggerService/LoggerService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Async-Repo-Start/README.md:
--------------------------------------------------------------------------------
1 | ## async-repository-dotnetcore-webapi
2 | # Async Repository in ASP.NET Core Web API - start project
3 | https://code-maze.com/async-generic-repository-pattern/
4 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Repository/AccountRepository.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using Entities;
3 | using Entities.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 |
8 | namespace Repository
9 | {
10 | public class AccountRepository : RepositoryBase, IAccountRepository
11 | {
12 | public AccountRepository(RepositoryContext repositoryContext)
13 | : base(repositoryContext)
14 | {
15 | }
16 |
17 | public IEnumerable AccountsByOwner(Guid ownerId)
18 | {
19 | return FindByCondition(a => a.OwnerId.Equals(ownerId)).ToList();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Repository/OwnerRepository.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using Entities;
3 | using Entities.Models;
4 | using Microsoft.EntityFrameworkCore;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 |
9 | namespace Repository
10 | {
11 | public class OwnerRepository : RepositoryBase, IOwnerRepository
12 | {
13 | public OwnerRepository(RepositoryContext repositoryContext)
14 | : base(repositoryContext)
15 | {
16 | }
17 |
18 | public IEnumerable GetAllOwners()
19 | {
20 | return FindAll()
21 | .OrderBy(ow => ow.Name)
22 | .ToList();
23 | }
24 |
25 | public Owner GetOwnerById(Guid ownerId)
26 | {
27 | return FindByCondition(owner => owner.Id.Equals(ownerId))
28 | .FirstOrDefault();
29 | }
30 |
31 | public Owner GetOwnerWithDetails(Guid ownerId)
32 | {
33 | return FindByCondition(owner => owner.Id.Equals(ownerId))
34 | .Include(ac => ac.Accounts)
35 | .FirstOrDefault();
36 | }
37 |
38 | public void CreateOwner(Owner owner)
39 | {
40 | Create(owner);
41 | }
42 |
43 | public void UpdateOwner(Owner owner)
44 | {
45 | Update(owner);
46 | }
47 |
48 | public void DeleteOwner(Owner owner)
49 | {
50 | Delete(owner);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Repository/Repository.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Repository/RepositoryBase.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using Entities;
3 | using Microsoft.EntityFrameworkCore;
4 | using System;
5 | using System.Linq;
6 | using System.Linq.Expressions;
7 |
8 | namespace Repository
9 | {
10 | public abstract class RepositoryBase : IRepositoryBase where T : class
11 | {
12 | protected RepositoryContext RepositoryContext { get; set; }
13 | public RepositoryBase(RepositoryContext repositoryContext)
14 | {
15 | RepositoryContext = repositoryContext;
16 | }
17 |
18 | public IQueryable FindAll()
19 | {
20 | return RepositoryContext.Set().AsNoTracking();
21 | }
22 |
23 | public IQueryable FindByCondition(Expression> expression)
24 | {
25 | return RepositoryContext.Set().Where(expression).AsNoTracking();
26 | }
27 |
28 | public void Create(T entity)
29 | {
30 | RepositoryContext.Set().Add(entity);
31 | }
32 |
33 | public void Update(T entity)
34 | {
35 | RepositoryContext.Set().Update(entity);
36 | }
37 |
38 | public void Delete(T entity)
39 | {
40 | RepositoryContext.Set().Remove(entity);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Async-Repo-Start/Repository/RepositoryWrapper.cs:
--------------------------------------------------------------------------------
1 | using Contracts;
2 | using Entities;
3 |
4 | namespace Repository
5 | {
6 | public class RepositoryWrapper : IRepositoryWrapper
7 | {
8 | private RepositoryContext _repoContext;
9 | private IOwnerRepository _owner;
10 | private IAccountRepository _account;
11 | public IOwnerRepository Owner
12 | {
13 | get
14 | {
15 | if (_owner == null)
16 | {
17 | _owner = new OwnerRepository(_repoContext);
18 | }
19 | return _owner;
20 | }
21 | }
22 |
23 | public IAccountRepository Account
24 | {
25 | get
26 | {
27 | if (_account == null)
28 | {
29 | _account = new AccountRepository(_repoContext);
30 | }
31 | return _account;
32 | }
33 | }
34 |
35 | public RepositoryWrapper(RepositoryContext repositoryContext)
36 | {
37 | _repoContext = repositoryContext;
38 | }
39 |
40 | public void Save()
41 | {
42 | _repoContext.SaveChanges();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Async-Repo-Start/_MySQL_Init_Script/init.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: accountowner
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.17-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `account`
20 | --
21 |
22 | DROP TABLE IF EXISTS `account`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `account` (
26 | `AccountId` char(36) NOT NULL,
27 | `DateCreated` date NOT NULL,
28 | `AccountType` varchar(45) NOT NULL,
29 | `OwnerId` char(36) NOT NULL,
30 | PRIMARY KEY (`AccountId`),
31 | KEY `fk_Account_Owner_idx` (`OwnerId`),
32 | CONSTRAINT `fk_Account_Owner` FOREIGN KEY (`OwnerId`) REFERENCES `owner` (`OwnerId`) ON UPDATE CASCADE
33 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
34 | /*!40101 SET character_set_client = @saved_cs_client */;
35 |
36 | --
37 | -- Dumping data for table `account`
38 | --
39 |
40 | LOCK TABLES `account` WRITE;
41 | /*!40000 ALTER TABLE `account` DISABLE KEYS */;
42 | INSERT INTO `account` VALUES ('03e91478-5608-4132-a753-d494dafce00b','2003-12-15','Domestic','f98e4d74-0f68-4aac-89fd-047f1aaca6b6'),('356a5a9b-64bf-4de0-bc84-5395a1fdc9c4','1996-02-15','Domestic','261e1685-cf26-494c-b17c-3546e65f5620'),('371b93f2-f8c5-4a32-894a-fc672741aa5b','1999-05-04','Domestic','24fd81f8-d58a-4bcc-9f35-dc6cd5641906'),('670775db-ecc0-4b90-a9ab-37cd0d8e2801','1999-12-21','Savings','24fd81f8-d58a-4bcc-9f35-dc6cd5641906'),('a3fbad0b-7f48-4feb-8ac0-6d3bbc997bfc','2010-05-28','Domestic','a3c1880c-674c-4d18-8f91-5d3608a2c937'),('aa15f658-04bb-4f73-82af-82db49d0fbef','1999-05-12','Foreign','24fd81f8-d58a-4bcc-9f35-dc6cd5641906'),('c6066eb0-53ca-43e1-97aa-3c2169eec659','1996-02-16','Foreign','261e1685-cf26-494c-b17c-3546e65f5620'),('eccadf79-85fe-402f-893c-32d3f03ed9b1','2010-06-20','Foreign','a3c1880c-674c-4d18-8f91-5d3608a2c937');
43 | /*!40000 ALTER TABLE `account` ENABLE KEYS */;
44 | UNLOCK TABLES;
45 |
46 | --
47 | -- Table structure for table `owner`
48 | --
49 |
50 | DROP TABLE IF EXISTS `owner`;
51 | /*!40101 SET @saved_cs_client = @@character_set_client */;
52 | /*!40101 SET character_set_client = utf8 */;
53 | CREATE TABLE `owner` (
54 | `OwnerId` char(36) NOT NULL,
55 | `Name` varchar(60) NOT NULL,
56 | `DateOfBirth` date NOT NULL,
57 | `Address` varchar(100) NOT NULL,
58 | PRIMARY KEY (`OwnerId`)
59 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
60 | /*!40101 SET character_set_client = @saved_cs_client */;
61 |
62 | --
63 | -- Dumping data for table `owner`
64 | --
65 |
66 | LOCK TABLES `owner` WRITE;
67 | /*!40000 ALTER TABLE `owner` DISABLE KEYS */;
68 | INSERT INTO `owner` VALUES ('24fd81f8-d58a-4bcc-9f35-dc6cd5641906','John Keen','1980-12-05','61 Wellfield Road'),('261e1685-cf26-494c-b17c-3546e65f5620','Anna Bosh','1974-11-14','27 Colored Row'),('66774006-2371-4d5b-8518-2177bcf3f73e','Nick Somion','1998-12-15','North sunny address 102'),('a3c1880c-674c-4d18-8f91-5d3608a2c937','Sam Query','1990-04-22','91 Western Roads'),('f98e4d74-0f68-4aac-89fd-047f1aaca6b6','Martin Miller','1983-05-21','3 Edgar Buildings');
69 | /*!40000 ALTER TABLE `owner` ENABLE KEYS */;
70 | UNLOCK TABLES;
71 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
72 |
73 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
74 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
75 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
76 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
77 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
78 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
79 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
80 |
81 | -- Dump completed on 2017-12-24 15:53:17
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Async Repository in ASP.NET Core Web API
2 | https://code-maze.com/async-generic-repository-pattern/
3 |
--------------------------------------------------------------------------------